-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.98 KB
/
package.yml
File metadata and controls
72 lines (61 loc) · 1.98 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
name: Create and publish a Docker image
on:
push:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
token: ${{ secrets.TOKEN }}
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v7
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/nanoforge-dev/docs:latest
${{ env.REGISTRY }}/nanoforge-dev/docs:${{ github.sha }}
- name: checkout cloud
uses: actions/checkout@v5
with:
repository: nanoforge-dev/cloud-iac
token: ${{ secrets.TOKEN }}
path: cloud-tmp
- name: install yq and setup git
run: |
pip install yq
git config --global user.name "github-actions[bot]"
git config --global user.email "username@users.noreply.github.com"
- name: Update tag in values.yaml
run: |
cd cloud-tmp
python -m yq -Y --indentless --in-place '.image.tag = "${{ github.sha }}"' kubernetes/nanoforge/docs-override.yaml
git add kubernetes/nanoforge/docs-override.yaml
git commit -m "Update docs image tag to ${{ github.sha }}"
git push origin main
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true