Update docker pipeline to support pre-releases as well
This commit is contained in:
parent
8297c4635d
commit
1fe3862e57
|
@ -8,7 +8,7 @@ on:
|
|||
required: true
|
||||
|
||||
release:
|
||||
types: [released]
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
|
@ -16,7 +16,7 @@ permissions:
|
|||
|
||||
env:
|
||||
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
|
||||
|
||||
|
||||
jobs:
|
||||
# ===============================================================
|
||||
# Building Dev Images
|
||||
|
@ -26,7 +26,7 @@ jobs:
|
|||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
|
||||
- uses: dsaltares/fetch-gh-release-asset@master
|
||||
with:
|
||||
version: 'tags/${{ env.TAG_NAME }}'
|
||||
|
@ -38,7 +38,7 @@ jobs:
|
|||
- name: Set up QEMU
|
||||
id: qemu
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
with:
|
||||
platforms: arm64,amd64
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
|
@ -50,23 +50,24 @@ jobs:
|
|||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
- name: Extract artifacts
|
||||
run: |
|
||||
ls -l
|
||||
ls -l releases
|
||||
for f in releases/*.tar.gz; do tar xvfz $f -C releases; done
|
||||
rm releases/*.tar.gz
|
||||
|
||||
- name: Build dragonfly ubuntu
|
||||
|
||||
- name: Build release image
|
||||
if: ${{ !github.event.release.prerelease }}
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
|
||||
# Define QEMU settings inside the builder
|
||||
build-args: |
|
||||
QEMU_CPU=max,pauth-impdef=on
|
||||
QEMU_CPU=max,pauth-impdef=on
|
||||
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: |
|
||||
|
@ -74,7 +75,22 @@ jobs:
|
|||
ghcr.io/${{ github.repository }}:latest
|
||||
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }}
|
||||
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }}-ubuntu
|
||||
|
||||
|
||||
file: tools/docker/Dockerfile.ubuntu-prod
|
||||
cache-from: type=registry,ref=${{ github.repository }}:latest
|
||||
cache-to: type=inline
|
||||
|
||||
- name: Build pre-release image
|
||||
if: ${{ github.event.release.prerelease }}
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository }}:alpha
|
||||
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }}
|
||||
file: tools/docker/Dockerfile.ubuntu-prod
|
||||
cache-from: type=registry,ref=${{ github.repository }}:latest
|
||||
cache-to: type=inline
|
Loading…
Reference in New Issue