-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (62 loc) · 1.94 KB
/
Copy pathrelease-tag-latest.yml
File metadata and controls
75 lines (62 loc) · 1.94 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
70
71
72
73
74
75
name: Tag Latest Release
on:
workflow_dispatch:
inputs:
tag:
description: Flipt release version to attempt tagging
required: true
permissions:
contents: write
packages: write
env:
GO_VERSION: "1.25"
jobs:
tag-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- uses: actions/cache@v4
with:
path: _tools/
key: ${{ runner.os }}-go-tools${{ hashFiles('_tools/go.sum') }}
restore-keys: |
${{ runner.os }}-go-tools-
- name: Install Skopeo
run: |
sudo apt-get update
sudo apt-get -y install skopeo
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "${{ github.repository_owner }}"
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Mage
uses: magefile/mage-action@v3
with:
install-only: true
- name: Tag and Push latest
env:
TAG: ${{ inputs.tag }}
run: |
cd build
if [[ $TAG == $(mage release:latest go.flipt.io/flipt) ]]; then
docker pull flipt/flipt:$TAG
skopeo copy --all docker://flipt/flipt:$TAG docker://flipt/flipt:latest
docker pull markphelps/flipt:$TAG
skopeo copy --all docker://markphelps/flipt:$TAG docker://markphelps/flipt:latest
docker pull ghcr.io/flipt-io/flipt:$TAG
skopeo copy --all docker://ghcr.io/flipt-io/flipt:$TAG docker://ghcr.io/flipt-io/flipt:latest
fi