-
Notifications
You must be signed in to change notification settings - Fork 23
46 lines (43 loc) · 1.7 KB
/
build_and_upload_docker_image_latest_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build and Upload Docker Image of Latest Release to GHCR
on:
workflow_run:
workflows: [auto-publish]
types: [completed]
workflow_dispatch:
push: # remove after merge; can't trigger manually until on main
concurrency: # Cancel previous workflows on the same pull request
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release-image:
name: Build and Upload Docker Image of Latest Release to GHCR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Parse the version from the GitHub latest release tag
id: parsed_version
run: |
git fetch --prune --unshallow --tags
tags="$(git tag --list)"
version_tag=${tags: -6 : 6}
echo "version_tag=$version_tag" >> $GITHUB_OUTPUT
- name: Printout parsed version for GitHub Action log
run: echo ${{ steps.parsed_version.outputs.version_tag }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_UPLOADER_USERNAME }}
password: ${{ secrets.DOCKER_UPLOADER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true # Push is a shorthand for --output=type=registry
tags: ghcr.io/catalystneuro/neuroconv:latest,ghcr.io/catalystneuro/neuroconv:${{ steps.parsed_version.outputs.version_tag }}
context: .
file: dockerfiles/neuroconv_latest_release_dockerfile