-
Notifications
You must be signed in to change notification settings - Fork 22
82 lines (80 loc) · 2.59 KB
/
publish.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: 🚀 Publish
on:
push:
tags:
- 'capacitor-v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write # Required for creating the GitHub release
packages: write # Required for pushing to GitHub Container Registry
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22.1
- name: ⬇️ Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Version
id: version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]
then
tag=${GITHUB_REF##refs/tags/}
v=${tag##capacitor-}
echo "::set-output name=version::$v"
else
echo "::set-output name=version::$GITHUB_SHA"
fi
- name: 🏗️ Build UI
run: make build-ui
- name: Dist
run: make dist
env:
VERSION: ${{ steps.version.outputs.version }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Capacitor ${{ steps.version.outputs.version }}
draft: false
prerelease: false
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }} # `PAT` is a secret that contains your Personal Access Token with `write:packages` scope
- name: Build and push Gimlet image
uses: docker/[email protected]
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
ghcr.io/gimlet-io/capacitor:${{ steps.version.outputs.version }}
- name: Set up Flux CLI
uses: fluxcd/flux2/[email protected]
- name: Push manifests
run: |
flux push artifact \
oci://ghcr.io/gimlet-io/capacitor-manifests:${{ steps.version.outputs.version }} \
--path=deploy/k8s \
--source=${{ github.repositoryUrl }} \
--revision="${{ github.ref_name }}@sha1:${{ github.sha }}" \
--annotations='org.opencontainers.image.description=Capacitor install manifests for Flux'