ArchiSteamFarm/.github/workflows/docker-publish-latest.yml

72 lines
2.1 KiB
YAML
Raw Normal View History

name: ASF-docker-publish-latest
on:
release:
types: [released]
env:
2021-08-01 10:56:08 +00:00
ASF_PRIVATE_SNK: ${{ secrets.ASF_PRIVATE_SNK }}
PLATFORMS: linux/amd64,linux/arm,linux/arm64
TAG: latest
jobs:
main:
runs-on: ubuntu-latest
steps:
2021-02-09 16:48:24 +00:00
- name: Checkout code
uses: actions/checkout@v3.3.0
2021-02-09 16:48:24 +00:00
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.4.0
- name: Login to ghcr.io
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
2021-12-20 13:07:41 +00:00
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2021-08-01 10:56:08 +00:00
- name: Prepare private key for signing
shell: sh
run: |
2021-08-01 11:00:14 +00:00
set -eu
if [ -n "${ASF_PRIVATE_SNK-}" ]; then
echo "$ASF_PRIVATE_SNK" | base64 -d > "resources/ArchiSteamFarm.snk"
fi
2021-08-01 10:56:08 +00:00
- name: Prepare environment outputs
shell: sh
run: |
2021-01-02 14:47:30 +00:00
set -eu
echo "FIXED_TAG=$(echo ${{ github.ref }} | cut -d '/' -f 3)" >> "$GITHUB_ENV"
echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV"
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"
- name: Build and publish Docker image from Dockerfile.Service
uses: docker/build-push-action@v3.3.0
with:
2021-02-09 16:48:24 +00:00
context: .
file: Dockerfile.Service
platforms: ${{ env.PLATFORMS }}
build-args: STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
labels: |
org.opencontainers.image.created=${{ env.DATE_ISO8601 }}
org.opencontainers.image.version=${{ env.FIXED_TAG }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}
${{ env.DH_REPOSITORY }}:${{ env.TAG }}
push: true