From afe9304a13626858c56548ec06b76adcc231e0cf Mon Sep 17 00:00:00 2001 From: BPierrick Date: Mon, 17 Jan 2022 15:04:39 +0100 Subject: [PATCH] ci: fix publish job --- .github/workflows/app.yml | 39 ------------------------ .github/workflows/build-and-publish.yml | 40 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/build-and-publish.yml diff --git a/.github/workflows/app.yml b/.github/workflows/app.yml index 1f5c234..6f9d98a 100644 --- a/.github/workflows/app.yml +++ b/.github/workflows/app.yml @@ -2,15 +2,9 @@ name: app on: push: - paths: - - "**" branches: - main - tags: - - "v*" pull_request: - paths: - - "**" jobs: lint-and-test: @@ -26,36 +20,3 @@ jobs: - name: Run tests run: yarn test working-directory: . - build-and-publish: - needs: lint-and-test - runs-on: ubuntu-18.04 - steps: - - id: docker_meta - name: Docker Metadata action - uses: docker/metadata-action@v3.3.0 - with: - images: arkhn/patient-timeline - tags: | - type=semver,pattern={{version}} - type=ref,event=branch - type=sha - - uses: actions/checkout@v2 - - uses: docker/setup-qemu-action@v1 - - uses: docker/setup-buildx-action@v1 - with: - driver-opts: network=host - - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_LOGIN }} - password: ${{ secrets.DOCKER_PASSWORD }} - - uses: docker/build-push-action@v2 - with: - file: ./Dockerfile - build-args: | - VERSION_NAME=${{ steps.docker_meta.outputs.version }} - VERSION_SHA=${GITHUB_SHA::8} - platforms: linux/amd64 - # always push images to the hub - push: true - tags: ${{ steps.docker_meta.outputs.tags }} - labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..07a3b69 --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,40 @@ +name: build-and-publish + +on: + push: + tags: + - "v*" + +jobs: + build-and-publish: + runs-on: ubuntu-18.04 + steps: + - id: docker_meta + name: Docker Metadata action + uses: docker/metadata-action@v3.3.0 + with: + images: arkhn/patient-timeline + tags: | + type=semver,pattern={{version}} + type=ref,event=branch + type=sha + - uses: actions/checkout@v2 + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + with: + driver-opts: network=host + - uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_LOGIN }} + password: ${{ secrets.DOCKER_PASSWORD }} + - uses: docker/build-push-action@v2 + with: + file: ./Dockerfile + build-args: | + VERSION_NAME=${{ steps.docker_meta.outputs.version }} + VERSION_SHA=${GITHUB_SHA::8} + platforms: linux/amd64 + # always push images to the hub + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }}