63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
name: Publish Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
paths:
|
|
- 'release-versions/latest.txt'
|
|
env:
|
|
IMAGE_REPO: mrtyton
|
|
IMAGE_NAME: automated-ffdl
|
|
|
|
jobs:
|
|
Push-New-Release-Version-Image:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Get environment variables
|
|
uses: FranzDiebold/github-env-vars-action@v2
|
|
|
|
- name: Set version
|
|
run: |
|
|
RELEASE_VERSION=$(cat release-versions/latest.txt)
|
|
echo "RELEASE_VERSION=latest" >> $GITHUB_ENV
|
|
CALIBRE_VERSION=$(cat release-versions/calibre.txt)
|
|
echo "CALIBRE_VERSION=$CALIBRE_VERSION" >> $GITHUB_ENV
|
|
FFF_VERSION=$(cat release-versions/fff.txt)
|
|
echo "FFF_VERSION=$FFF_VERSION" >> $GITHUB_ENV
|
|
- name: Print image tag
|
|
run: |
|
|
echo "Branch: $CI_ACTION_REF_NAME"
|
|
echo "Release Version: ${{ env.RELEASE_VERSION }}"
|
|
echo "Calibre Version: ${{ env.CALIBRE_VERSION }}"
|
|
echo "FFF Version: ${{ env.FFF_VERSION }}"
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USER }}
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
|
|
build-args: |
|
|
VERSION=${{ env.RELEASE_VERSION }}
|
|
CALIBRE_RELEASE=${{ env.CALIBRE_VERSION }}
|
|
FFF_RELEASE=${{ env.FFF_VERSION }}
|