-
Notifications
You must be signed in to change notification settings - Fork 31
77 lines (66 loc) · 2.34 KB
/
build.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Website build
on:
push:
branches:
- 2016-redesign
tags:
- '*'
jobs:
build:
runs-on: debian:bullseye
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: '2.7'
- name: Install packages
run: |
sudo apt-get -y install gettext libjpeg-turbo-progs optipng python3-pip python3-virtualenv subversion
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }}
- name: Install pelican & pelican plugins
run: |
pip install -r requirements.txt
svn co https://github.com/getpelican/pelican-plugins.git/trunk pelican-plugins
- name: Build
run: |
if [[ $GITHUB_REF == "refs/heads/2016-redesign" ]]
then
export SITEURL="https://staging.freenetproject.org"
else
export SITEURL="https://freenetproject.org"
fi
make html
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload to bucket
run: |
aws configure set preview.cloudfront true
if [[ $GITHUB_REF == "refs/heads/2016-redesign" ]]
then
echo "deploying to staging"
aws s3 sync output/ s3://website-staging.freenetproject.org
aws cloudfront create-invalidation --distribution-id E163US17FGFURH --paths '/*'
else
echo "deploying to prod"
aws s3 sync output/ s3://website-freenetproject.org
aws cloudfront create-invalidation --distribution-id E27NPK5X62XM5M --paths '/*'
fi
env:
GITHUB_REF: ${{ env.GITHUB_REF }}
- name: IRC notify
uses: rectalogic/notify-irc@v1
with:
channel: "#freenet"
server: irc.libera.chat
nickname: github-actions-notify
message:
${{ github.actor }} deployed ${{ github.event.compare }} to the website (${{ github.event.ref }}).