-
Notifications
You must be signed in to change notification settings - Fork 155
70 lines (64 loc) · 2.1 KB
/
publish_site.yaml
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
name: publish_site
on:
push:
branches:
- master
tags:
- 'v*'
env:
GHCR: ghcr.io
HELM_VERSION: 3.8.2
jobs:
site:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine version
run: echo "PIPECD_VERSION=$(git describe --tags --always --abbrev=7)" >> $GITHUB_ENV
- name: Setup Hugo
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f #v3.0.0
with:
hugo-version: '0.128.0'
extended: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '14'
# Build site.
- name: Build site
run: |
cd docs
npm install autoprefixer
npm install postcss-cli
env HUGO_ENV="production" RELEASE="$(grep '^tag:' ../RELEASE | awk '{print $2}')" hugo
# Building and pushing container images.
- name: Log in to the container registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b #v2.0.0
with:
registry: ${{ env.GHCR }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push site image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 #v5.0.0
with:
push: true
context: docs
file: docs/Dockerfile
tags: ${{ env.GHCR }}/pipe-cd/site:${{ env.PIPECD_VERSION }}
# Building and pushing Helm charts.
- name: Install helm
uses: Azure/setup-helm@v1
with:
version: ${{ env.HELM_VERSION }}
- name: Login to OCI using Helm
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ env.GHCR }} --username ${{ github.repository_owner }} --password-stdin
- name: Publish site chart
run: |
make build/chart MOD=site VERSION=${{ env.PIPECD_VERSION }}
helm push .artifacts/site-${{ env.PIPECD_VERSION }}.tgz oci://${{ env.GHCR }}/pipe-cd/chart