From 7f239bc0d4126e3f8f24cae5e81787e9642262be Mon Sep 17 00:00:00 2001 From: Falk Date: Tue, 24 Jan 2023 16:49:57 +0100 Subject: [PATCH] chore(ci): publish container image to ghcr.io --- .github/workflows/release-image.yml | 47 +++++++++++++++++++ .../{release.yml => release-npm.yml} | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-image.yml rename .github/workflows/{release.yml => release-npm.yml} (96%) diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml new file mode 100644 index 000000000..ca9c52a2e --- /dev/null +++ b/.github/workflows/release-image.yml @@ -0,0 +1,47 @@ +name: Release Container Image + +on: + push: + branches: master + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" + +jobs: + container: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/adfinis/timed-frontend + flavor: | + latest=auto + labels: | + org.opencontainers.image.title=${{ github.event.repository.name }} + org.opencontainers.image.description=${{ github.event.repository.description }} + org.opencontainers.image.url=${{ github.event.repository.html_url }} + org.opencontainers.image.source=${{ github.event.repository.clone_url }} + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event_name != 'pull_request' }} + + - name: Build and push + id: docker_build_ghcr + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: | + ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release-npm.yml similarity index 96% rename from .github/workflows/release.yml rename to .github/workflows/release-npm.yml index 51f5d4de3..d3138253d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-npm.yml @@ -1,4 +1,4 @@ -name: Release +name: Release npm package on: workflow_dispatch