skip the photos page #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
# tags: | |
# - v* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- id: get-version | |
uses: battila7/get-version-action@v2 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
#TODO: bring this back to 2.7 | |
ruby-version: '2.6' | |
#bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2.1.7 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- name: Install pngout | |
run: | | |
# wget http://static.jonof.id.au/dl/kenutils/pngout-20200115-linux-static.tar.gz | |
# tar -xvf pngout-20200115-linux-static.tar.gz | |
# sudo mv pngout-20200115-linux-static/x86_64/pngout /usr/local/bin/ | |
# rm -rf pngout-20200115-linux-static* | |
sudo apt-get update | |
sudo apt-get install -y wget | |
wget https://www.jonof.id.au/files/kenutils/pngout-20200115-linux.tar.gz | |
tar -xvf pngout-20200115-linux.tar.gz | |
ls -al | |
ls -al pngout-20200115-linux/x86_64 | |
sudo mv pngout-20200115-linux/x86_64/pngout /usr/local/bin/ | |
rm -rf pngout-20200115-linux* | |
- name: Install Gems | |
run: | | |
# use a bundler that supports our ancient ruby | |
gem install bundler -v 2.4.22 | |
bundle config path vendor/bundle | |
bundle install --jobs 4 --retry 3 | |
- name: Build the static site | |
run: bundle exec middleman build --bail | |
- name: Push the static site to stage | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }} | |
S3_BUCKET: ${{ secrets.STAGE_S3_BUCKET }} | |
run: aws s3 sync build $S3_BUCKET/build/ | |
# - name: Push the static site to prod | |
# env: | |
# AWS_ACCESS_KEY_ID: ${{ secrets.CI_PROD_AWS_ACCESS_KEY_ID }} | |
# AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_PROD_AWS_SECRET_ACCESS_KEY }} | |
# S3_BUCKET: ${{ secrets.PROD_S3_BUCKET }} | |
# run: aws s3 sync build $S3_BUCKET/build/ | |
- name: Post Discord notification | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
VERSION_TAG: ${{ steps.get-version.outputs.version }} | |
uses: Ilshidur/action-discord@0.3.2 | |
with: | |
args: 'New release created for [{{ EVENT_PAYLOAD.repository.full_name }}]({{ EVENT_PAYLOAD.repository.html_url }}): [{{ VERSION_TAG }}]({{ EVENT_PAYLOAD.compare }})' |