-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from LeonStoldt/feat/issue-9-arm64-image
Feat/issue 9 add arm64 image
- Loading branch information
Showing
10 changed files
with
246 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Build and push image | ||
description: "Builds docker image and pushes it to registry" | ||
|
||
inputs: | ||
platform: | ||
description: "Platform for docker build" | ||
default: "amd64" | ||
required: true | ||
ansible_image_tag: | ||
description: "Image tag of ansible base image" | ||
default: "alpine" | ||
required: true | ||
|
||
outputs: | ||
digests: | ||
description: "Image digests" | ||
value: ${{ steps.build-and-push.outputs.digest }} | ||
tags: | ||
description: "Image tags" | ||
value: ${{ steps.meta.outputs.tags }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Install the cosign tool except on PR https://github.com/sigstore/cosign-installer | ||
- name: Install cosign | ||
uses: sigstore/cosign-installer@v3.2.0 | ||
|
||
- name: Set up QEMU | ||
if: ${{ inputs.platform != 'amd64' }} | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: ${{ inputs.platform }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/${{ github.repository }} | ||
ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=raw,value=latest,enable=${{ is_default_branch && inputs.platform == 'amd64' }} | ||
type=raw,value=latest,suffix={{inputs.platform}},enable=${{ is_default_branch && inputs.platform != 'amd64' }} | ||
type=sha | ||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/${{ inputs.platform }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Sign the published Docker image | ||
shell: bash | ||
env: | ||
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable | ||
TAGS: ${{ steps.meta.outputs.tags }} | ||
DIGEST: ${{ steps.build-and-push.outputs.digest }} | ||
# This step uses the identity token to provision an ephemeral certificate against the sigstore community Fulcio instance. | ||
run: | | ||
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} | ||
- name: Set output variables | ||
shell: bash | ||
run: | | ||
echo "digests=${{ steps.build-and-push.outputs.digest }}" >> $GITHUB_OUTPUT | ||
echo "tags=${{ steps.meta.outputs.tags }}" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Run integration test | ||
description: "Runs the ansible container as integration test and checks if all containers are up and running" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install wait-for-it | ||
shell: bash | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y wait-for-it | ||
- name: Run integration test | ||
shell: bash | ||
run: | | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Post-run | ||
description: "Tasks to run after pipeline is done" | ||
|
||
inputs: | ||
digests: | ||
description: "Digests from previous build step" | ||
required: false | ||
tags: | ||
description: "Tags from previous build step" | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Update Docker Hub Description | ||
uses: peter-evans/dockerhub-description@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set job summary | ||
shell: bash | ||
run: | | ||
cat >> $GITHUB_STEP_SUMMARY <<EOB | ||
# Release Report | ||
## Registries | ||
- **Image Name:** ghostfolio-installer | ||
- [![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)](docker_hub_url) | ||
- ![GitHub](https://img.shields.io/badge/ghcr.io-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)(ghcr_io_url) | ||
## Image Digests | ||
> ${{ inputs.tags }}" | ||
## Image Digests | ||
> ${{ inputs.digests }}" | ||
[docker_hub_url]: https://hub.docker.com/r/${{ github.repository_owner }}/${{ github.repository }} | ||
[ghcr_io_url]: ${{ github.server_url}}/${{ github.repository_owner }}/${{ github.repository }}/pkgs/container/${{ github.repository }} | ||
EOB |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Release Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 9 * * 5' | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
integration-test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/integration-test | ||
|
||
release: | ||
needs: [integration-test] | ||
name: Build and push image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
fail-fast: false | ||
include: | ||
- platform: amd64 | ||
base_image_tag: 2.15-alpine-3.18 | ||
- platform: arm64 | ||
ansible_image_tag: alpine | ||
permissions: | ||
contents: read | ||
packages: write | ||
# This is used to complete the identity challenge with sigstore/fulcio when running outside of PRs. | ||
id-token: write | ||
outputs: | ||
digests: ${{ steps.build.outputs.digests }} | ||
tags: ${{ steps.build.outputs.tags }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/build-and-push | ||
id: build | ||
with: | ||
platform: ${{ matrix.platform }} | ||
ansible_image_tag: ${{ matrix.ansible_image_tag }} | ||
|
||
post-run: | ||
needs: [ release ] | ||
name: Post-run | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/post-run | ||
with: | ||
digests: ${{ needs.release.outputs.digests }} | ||
tags: ${{ needs.release.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Run integration tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
integration-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/integration-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea | ||
ansible/playbooks/templates/.env | ||
ansible/playbooks/templates/.env | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters