-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (54 loc) · 1.87 KB
/
docker-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- 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/[email protected]
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 }}