-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (67 loc) · 2.25 KB
/
release.yaml
File metadata and controls
69 lines (67 loc) · 2.25 KB
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
63
64
65
66
67
68
69
name: Release docker image
on:
release:
types:
- released
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=sirily11/etd-remote-admin-server
VERSION=${{ github.event.release.tag_name }}
TAGS="${DOCKER_IMAGE}:${VERSION}"
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
APP_ID=${{ secrets.APP_ID }}
PUBLIC_STATS_SERVER=${{secrets.PUBLIC_STATS_SERVER}}
NEXT_PUBLIC_SECRET=${{secrets.NEXT_PUBLIC_SECRET}}
VERSION=${{ steps.prep.outputs.tags }}
- name: Push Image to multiple registries
uses: akhilerm/tag-push-action@v2.0.0
with:
src: docker.io/${{ steps.prep.outputs.tags }}
dst: |
ghcr.io/${{ github.repository }}:${{ steps.prep.outputs.version }}