From a789196f539e56035b6c62b577cdfc7bd5f60eff Mon Sep 17 00:00:00 2001 From: thursday Date: Wed, 17 Nov 2021 18:30:57 -0500 Subject: Adding updated Docker image build workflow (#83) --- .github/workflows/build-and-publish.yml | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/build-and-publish.yml (limited to '.github/workflows/build-and-publish.yml') diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..bd24f9c --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,63 @@ +name: Build and Publish Docker Image + +on: + push: + tags: + - 'v*.*.*' + release: + types: [published] + workflow_dispatch: + +jobs: + image-build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + getferdi/ferdi-server +# ghcr.io/getferdi/ferdi-server + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }}, getferdi/ferdi-server:latest + labels: ${{ steps.meta.outputs.labels }} + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} -- cgit v1.2.3-70-g09d2 From 35373f13ce1ed210a8479c31a1260f8201bf0389 Mon Sep 17 00:00:00 2001 From: kytwb <412895+kytwb@users.noreply.github.com> Date: Fri, 19 Nov 2021 16:26:47 +0100 Subject: Use GH_TOKEN secret instead of GITHUB_TOKEN Failed to add secret; secret names must not start with GITHUB_. --- .github/workflows/build-and-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows/build-and-publish.yml') diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index bd24f9c..d40056a 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -46,7 +46,7 @@ jobs: with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GH_TOKEN }} - name: Build and push id: docker_build -- cgit v1.2.3-70-g09d2