s/gogs/gitea #51
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: 'formations' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- run: /bin/bash -x build.sh -l fr | |
- run: /bin/bash -x build.sh -l en | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: artifacts | |
path: | | |
output-pdf/ | |
output-html/ | |
images/ | |
retention-days: 1 | |
upload-styles: | |
name: Upload themes to Amazon S3 | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
env: | |
AWS_S3_BUCKET: particule-training | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- 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: eu-west-3 | |
- name: Copy themes to S3 | |
run: | | |
for dir in styles/* ; do | |
if [ -d "$dir" ] ; then | |
aws s3 cp "$dir".css s3://$AWS_S3_BUCKET/formations/revealjs/css/theme/ && | |
aws s3 cp styles/"$(basename $dir)" s3://$AWS_S3_BUCKET/formations/revealjs/css/theme/"$(basename $dir)" --recursive ; | |
fi ; | |
done | |
upload: | |
name: Upload trainings to Amazon S3 | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: build | |
env: | |
AWS_S3_BUCKET: particule-training | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- 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: eu-west-3 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifacts | |
- name: Copy trainings to S3 | |
run: | | |
aws s3 cp images s3://$AWS_S3_BUCKET/formations/images --recursive | |
aws s3 cp output-html s3://$AWS_S3_BUCKET/formations --recursive | |
aws s3 cp output-pdf s3://$AWS_S3_BUCKET/formations/pdf --recursive | |
- name: 'slack:success' | |
if: success() | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel: ${{ secrets.SLACK_CHANNEL }} | |
status: SUCCESS | |
color: good | |
- name: 'slack:failure' | |
if: failure() | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel: ${{ secrets.SLACK_CHANNEL }} | |
status: failure | |
color: danger |