-
Notifications
You must be signed in to change notification settings - Fork 153
70 lines (64 loc) · 2.08 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
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@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6 #v2.5.0
with:
hugo-version: '0.92.1'
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="$(head -n 1 ../RELEASE | cut -d ' ' -f 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@ad44023a93711e3deb337508980b4b5e9bcdc5dc
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