-
Notifications
You must be signed in to change notification settings - Fork 15
66 lines (57 loc) · 1.8 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (57 loc) · 1.8 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
name: Release
on:
workflow_dispatch:
inputs:
TAG:
description: Console tag used for release (eg. '1.2.3')
required: true
type: string
jobs:
release:
name: Create new release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checks-out repository
uses: actions/checkout@v4
- name: Pre release new version
run: |
gh release create v${{ inputs.TAG }} --latest --notes "Cloud Pi Native Documentation - Console v${{ inputs.TAG }}"
build:
name: Build application
runs-on: ubuntu-latest
needs:
- release
permissions:
contents: read
packages: write
steps:
- name: Checks-out repository
uses: actions/checkout@v4
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU (for multi platform build)
uses: docker/setup-qemu-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: true
- name: Build docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ inputs.TAG }}
target: prod
platforms: linux/amd64,linux/arm64
push: true
- name: Deploy new image
run: |
curl -X POST https://gitops.fabrique-numerique.fr/api/v1/applications/cloud-pi-native-docs/sync \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${{ secrets.ARGOCD_TOKEN }}" \
-d '${{ vars.ARGOCD_SYNC_PAYLOAD }}'