2021-01-02 13:49:03 +00:00
|
|
|
name: ASF-docker-publish-released
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
env:
|
2021-05-20 21:47:22 +00:00
|
|
|
PLATFORMS: linux/amd64,linux/arm,linux/arm64
|
2021-01-02 13:49:03 +00:00
|
|
|
TAG: released
|
|
|
|
|
2023-11-19 18:33:42 +00:00
|
|
|
permissions:
|
|
|
|
packages: write
|
|
|
|
|
2021-01-02 13:49:03 +00:00
|
|
|
jobs:
|
|
|
|
main:
|
2024-05-23 18:06:09 +00:00
|
|
|
environment: release-docker
|
2021-01-02 13:49:03 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2021-02-09 16:48:24 +00:00
|
|
|
- name: Checkout code
|
2024-06-12 20:57:14 +00:00
|
|
|
uses: actions/checkout@v4.1.7
|
2021-02-09 16:48:24 +00:00
|
|
|
with:
|
2023-09-04 17:19:48 +00:00
|
|
|
show-progress: false
|
2021-02-09 16:48:24 +00:00
|
|
|
submodules: recursive
|
|
|
|
|
2021-01-02 13:49:03 +00:00
|
|
|
- name: Set up Docker Buildx
|
2024-04-08 10:20:58 +00:00
|
|
|
uses: docker/setup-buildx-action@v3.3.0
|
2021-01-02 13:49:03 +00:00
|
|
|
|
|
|
|
- name: Login to ghcr.io
|
2024-05-28 09:56:27 +00:00
|
|
|
uses: docker/login-action@v3.2.0
|
2021-01-02 13:49:03 +00:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
2021-12-20 13:07:41 +00:00
|
|
|
username: ${{ github.actor }}
|
2021-05-24 08:25:47 +00:00
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2021-01-02 13:49:03 +00:00
|
|
|
|
|
|
|
- name: Login to DockerHub
|
2024-05-28 09:56:27 +00:00
|
|
|
uses: docker/login-action@v3.2.0
|
2021-01-02 13:49:03 +00:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Prepare environment outputs
|
|
|
|
shell: sh
|
|
|
|
run: |
|
2021-01-02 14:47:30 +00:00
|
|
|
set -eu
|
|
|
|
|
2021-01-02 14:38:36 +00:00
|
|
|
echo "FIXED_TAG=$(echo ${{ github.ref }} | cut -d '/' -f 3)" >> "$GITHUB_ENV"
|
2021-01-02 17:33:16 +00:00
|
|
|
echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV"
|
2021-01-02 13:49:03 +00:00
|
|
|
echo "GHCR_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
|
|
|
|
echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
|
|
|
|
|
2021-05-20 21:47:22 +00:00
|
|
|
- name: Build and publish Docker image from Dockerfile
|
2024-06-26 15:51:30 +00:00
|
|
|
uses: docker/build-push-action@v6.2.0
|
2021-01-02 13:49:03 +00:00
|
|
|
with:
|
2021-02-09 16:48:24 +00:00
|
|
|
context: .
|
2021-05-20 21:47:22 +00:00
|
|
|
platforms: ${{ env.PLATFORMS }}
|
2024-04-17 23:46:49 +00:00
|
|
|
provenance: true
|
|
|
|
sbom: true
|
2024-05-29 12:28:18 +00:00
|
|
|
secrets: |
|
|
|
|
ASF_PRIVATE_SNK=${{ secrets.ASF_PRIVATE_SNK }}
|
|
|
|
STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
|
2021-01-02 17:33:16 +00:00
|
|
|
labels: |
|
|
|
|
org.opencontainers.image.created=${{ env.DATE_ISO8601 }}
|
|
|
|
org.opencontainers.image.version=${{ env.FIXED_TAG }}
|
|
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
2021-01-02 13:49:03 +00:00
|
|
|
tags: |
|
|
|
|
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}
|
|
|
|
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.FIXED_TAG }}
|
|
|
|
${{ env.DH_REPOSITORY }}:${{ env.TAG }}
|
|
|
|
${{ env.DH_REPOSITORY }}:${{ env.FIXED_TAG }}
|
|
|
|
push: true
|