2022-02-25 16:45:12 +00:00
|
|
|
name: docker release
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-05-30 08:24:56 +00:00
|
|
|
inputs:
|
|
|
|
TAG_NAME:
|
|
|
|
description: 'Tag name that the major tag will point to'
|
|
|
|
required: true
|
2022-06-06 15:32:11 +00:00
|
|
|
PRERELEASE:
|
|
|
|
description: 'Whether this is a prerelease'
|
|
|
|
type: boolean
|
|
|
|
required: false
|
2022-05-30 08:24:56 +00:00
|
|
|
|
|
|
|
release:
|
2022-06-06 13:47:59 +00:00
|
|
|
types: [published]
|
2022-02-25 16:45:12 +00:00
|
|
|
|
2022-05-11 17:37:25 +00:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
contents: read
|
|
|
|
|
2022-05-30 08:24:56 +00:00
|
|
|
env:
|
|
|
|
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
|
2022-06-08 11:46:46 +00:00
|
|
|
IS_PRERELEASE: ${{ github.event.release.prerelease == true || github.event.inputs.PRERELEASE }}
|
2022-06-06 13:47:59 +00:00
|
|
|
|
2022-02-25 16:45:12 +00:00
|
|
|
jobs:
|
|
|
|
# ===============================================================
|
|
|
|
# Building Dev Images
|
|
|
|
# ===============================================================
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
2022-05-31 14:42:05 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-06-06 13:47:59 +00:00
|
|
|
|
2022-05-30 08:24:56 +00:00
|
|
|
- uses: dsaltares/fetch-gh-release-asset@master
|
2022-02-25 16:45:12 +00:00
|
|
|
with:
|
2022-05-30 12:51:48 +00:00
|
|
|
version: 'tags/${{ env.TAG_NAME }}'
|
2022-05-30 08:24:56 +00:00
|
|
|
regex: true
|
|
|
|
file: "dragonfly-.*\\.tar\\.gz"
|
|
|
|
target: 'releases/'
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2022-02-25 16:45:12 +00:00
|
|
|
|
2022-05-30 08:24:56 +00:00
|
|
|
- name: Set up QEMU
|
2022-04-25 09:06:31 +00:00
|
|
|
id: qemu
|
|
|
|
uses: docker/setup-qemu-action@v1
|
2022-06-06 13:47:59 +00:00
|
|
|
with:
|
2022-04-25 09:06:31 +00:00
|
|
|
platforms: arm64,amd64
|
|
|
|
|
2022-02-25 16:45:12 +00:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
|
|
|
- name: Login to GitHub Container Registry
|
2022-05-11 17:37:25 +00:00
|
|
|
uses: docker/login-action@v2
|
2022-02-25 16:45:12 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2022-06-06 13:47:59 +00:00
|
|
|
|
2022-05-30 08:24:56 +00:00
|
|
|
- name: Extract artifacts
|
|
|
|
run: |
|
2022-06-08 11:46:46 +00:00
|
|
|
echo "Event prerelease ${{ github.event.release.prerelease }}"
|
|
|
|
echo "Input prerelease ${{ github.event.inputs.PRERELEASE }}"
|
|
|
|
echo "env.IS_PRERELEASE ${{ env.IS_PRERELEASE}} "
|
2022-05-30 08:24:56 +00:00
|
|
|
ls -l
|
|
|
|
ls -l releases
|
2022-05-30 12:51:48 +00:00
|
|
|
for f in releases/*.tar.gz; do tar xvfz $f -C releases; done
|
|
|
|
rm releases/*.tar.gz
|
2022-06-06 13:47:59 +00:00
|
|
|
|
|
|
|
- name: Build release image
|
2022-06-08 11:46:46 +00:00
|
|
|
if: env.IS_PRERELEASE == 'false'
|
|
|
|
uses: docker/build-push-action@v3
|
2022-02-25 18:19:01 +00:00
|
|
|
with:
|
|
|
|
context: .
|
2022-04-25 09:06:31 +00:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2022-06-06 13:47:59 +00:00
|
|
|
|
2022-05-11 17:37:25 +00:00
|
|
|
# Define QEMU settings inside the builder
|
2022-05-05 09:05:05 +00:00
|
|
|
build-args: |
|
2022-06-06 13:47:59 +00:00
|
|
|
QEMU_CPU=max,pauth-impdef=on
|
2022-05-11 17:37:25 +00:00
|
|
|
|
2022-02-25 18:19:01 +00:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: |
|
2022-05-11 17:37:25 +00:00
|
|
|
ghcr.io/${{ github.repository }}:ubuntu
|
|
|
|
ghcr.io/${{ github.repository }}:latest
|
2022-05-31 11:04:08 +00:00
|
|
|
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }}
|
|
|
|
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }}-ubuntu
|
2022-06-06 13:47:59 +00:00
|
|
|
|
2022-05-11 17:37:25 +00:00
|
|
|
file: tools/docker/Dockerfile.ubuntu-prod
|
|
|
|
cache-from: type=registry,ref=${{ github.repository }}:latest
|
2022-05-30 08:24:56 +00:00
|
|
|
cache-to: type=inline
|
2022-06-06 13:47:59 +00:00
|
|
|
|
|
|
|
- name: Build pre-release image
|
2022-06-13 05:23:29 +00:00
|
|
|
if: env.IS_PRERELEASE == 'true'
|
2022-06-08 11:46:46 +00:00
|
|
|
uses: docker/build-push-action@v3
|
2022-06-06 13:47:59 +00:00
|
|
|
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
|