mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +00:00
2f7478b968
While floating tags are nice to use and fancy, we already had situations where the fixed source code did not result in the same deterministic build as the one built e.g. a week ago due to non-pinned versions that resulted in a different set of dependencies than originally. Since GitHub actions follow similar pattern, we want to do our best to ensure that if CI in given fixed version passed on a fixed source, then it should also result in the same deterministic output. Of course this is impossible to achieve in 100% (e.g. resources no longer being available over the network), but this is something we can do. It wasn't like that before renovate since we didn't have a standarized bot that could handle bumping those versions for us.
63 lines
2 KiB
YAML
63 lines
2 KiB
YAML
name: ASF-docker-publish-released
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
env:
|
|
PLATFORMS: linux/amd64,linux/arm,linux/arm64
|
|
TAG: released
|
|
|
|
jobs:
|
|
main:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2.3.4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1.4.1
|
|
|
|
- name: Login to ghcr.io
|
|
uses: docker/login-action@v1.10.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1.10.0
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Prepare environment outputs
|
|
shell: sh
|
|
run: |
|
|
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
|
|
uses: docker/build-push-action@v2.5.0
|
|
with:
|
|
context: .
|
|
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 }}
|
|
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.FIXED_TAG }}
|
|
${{ env.DH_REPOSITORY }}:${{ env.TAG }}
|
|
${{ env.DH_REPOSITORY }}:${{ env.FIXED_TAG }}
|
|
push: true
|