-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (33 loc) · 1.28 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: Build and deploy jekyll website
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup build environment
run: |
sudo gem install jekyll bundler
- name: Check out repository
uses: actions/checkout@v3
- name: Build website
run: |
sudo bundle install
bundle exec jekyll --version
bundle exec jekyll build
- name: Convert iCalendar file line endings to CRLF
run: |
cp _site/techaachen-calendar.ics _site/techaachen-calendar.ics.in
sed $'s/$/\r/' _site/techaachen-calendar.ics.in > _site/techaachen-calendar.ics
rm _site/techaachen-calendar.ics.in
- name: Upload to preview.techaachen.de
env:
UPLOAD_AUTH: ${{ secrets.UPLOAD_AUTH }}
run: |
export BRANCH=$(echo $GITHUB_REF | rev | cut -d/ -f1 | rev)
echo $BRANCH
cd _site
find * -type f -print | xargs -I@ curl -I --fail -X PUT --upload-file "@" "https://preview.techaachen.de/$BRANCH/@" --user $UPLOAD_AUTH