-
Notifications
You must be signed in to change notification settings - Fork 66
52 lines (47 loc) · 1.68 KB
/
CI.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
# This is a basic workflow to help you get started with Actions
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: iterate-ch/[email protected]
with:
docs-folder: "."
build-command: "make dirhtml"
- name: Cache artifacts
uses: actions/cache@v4
if: github.ref == 'refs/heads/main'
with:
key: html-${{ github.sha }}
path: ./_build/dirhtml
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Cache artifacts
uses: actions/cache@v4
with:
key: html-${{ github.sha }}
path: ./_build/dirhtml
- name: Install Cyberduck CLI
run: |
echo -e "deb https://s3.amazonaws.com/repo.deb.cyberduck.io stable main" | sudo tee /etc/apt/sources.list.d/cyberduck.list > /dev/null
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FE7097963FEFBE72
sudo apt-get update
sudo apt-get -y install duck
- name: Deploy
run: |
echo "Upload ./_build/dirhtml"
duck -y --username ${{ secrets.AWS_ACCESS_KEY_ID }} --password ${{ secrets.AWS_SECRET_ACCESS_KEY }} --existing compare --upload s3:/github-cyberduck-docs/ ./_build/dirhtml/* --region ${{ secrets.AWS_DEFAULT_REGION }}
echo "Purging CDN configuration"
duck -y --username ${{ secrets.AWS_ACCESS_KEY_ID }} --password ${{ secrets.AWS_SECRET_ACCESS_KEY }} --purge s3:/github-cyberduck-docs/