Skip to content

Commit

Permalink
Create publish_container_image.yml
Browse files Browse the repository at this point in the history
Workflow to package new image when a tag with version number is pushed to dev
  • Loading branch information
SevLG authored Dec 14, 2023
1 parent 2a27144 commit cb523b5
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/publish_container_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and push precision medicine portal container image
on:
push:
tags:
- 'v*.*.*'
jobs:
build_push_container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run docker/setup-qemu-action
uses: docker/setup-qemu-action@v3
- name: Run docker/setup-buildx-action
id: buildx
uses: docker/setup-buildx-action@v3
- name: List available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Run docker/login-action
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run docker/metadata-action
id: metadata_action_id
uses: docker/metadata-action@v5
with:
images: ghcr.io/ScilifelabDataCentre/precision-medicine-portal-frontend
flavor: |
latest=auto
tags: |
type=sha,format=long
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
labels: |
org.opencontainers.image.title=precision-medicine-portal-frontend
org.opencontainers.image.description=precision medicine web portal frontend
org.opencontainers.image.url=${{ github.event.repository.html_url }}
org.opencontainers.image.source=${{ github.event.repository.html_url }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.metadata_action_id.outputs.tags }}
labels: ${{ steps.metadata_action_id.outputs.labels }}

0 comments on commit cb523b5

Please sign in to comment.