Bump actions/checkout from 3 to 4 #40
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: ci | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build image | |
run: docker build -t crypto101 docker/ | |
- name: Generate documents | |
shell: 'script -q -e -c "bash {0}"' | |
run: | | |
set -x | |
set -e | |
docker run --rm -it -v ${{ github.workspace }}:/repo crypto101 ./build_release ./_release/ | |
- name: Upload document | |
uses: actions/upload-artifact@v3 | |
with: | |
name: crypto101-en.epub | |
path: _release/crypto101-en.epub | |
- name: Upload document | |
uses: actions/upload-artifact@v3 | |
with: | |
name: crypto101-en.pdf | |
path: _release/crypto101-en.pdf | |
- name: Upload document | |
uses: actions/upload-artifact@v3 | |
with: | |
name: crypto101-en_html.tar.gz | |
path: _release/crypto101-en_html.tar.gz | |
- name: Upload document | |
uses: actions/upload-artifact@v3 | |
with: | |
name: crypto101-fr.epub | |
path: _release/crypto101-fr.epub | |
- name: Upload document | |
uses: actions/upload-artifact@v3 | |
with: | |
name: crypto101-fr.pdf | |
path: _release/crypto101-fr.pdf | |
- name: Upload document | |
uses: actions/upload-artifact@v3 | |
with: | |
name: crypto101-fr_html.tar.gz | |
path: _release/crypto101-fr_html.tar.gz | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-22.04 | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- name: Download document | |
uses: actions/download-artifact@v3 | |
with: | |
name: crypto101-en.epub | |
path: /tmp | |
- name: Download document | |
uses: actions/download-artifact@v3 | |
with: | |
name: crypto101-en.pdf | |
path: /tmp | |
- name: Download document | |
uses: actions/download-artifact@v3 | |
with: | |
name: crypto101-en_html.tar.gz | |
path: /tmp | |
- name: Download document | |
uses: actions/download-artifact@v3 | |
with: | |
name: crypto101-fr.epub | |
path: /tmp | |
- name: Download document | |
uses: actions/download-artifact@v3 | |
with: | |
name: crypto101-fr.pdf | |
path: /tmp | |
- name: Download document | |
uses: actions/download-artifact@v3 | |
with: | |
name: crypto101-fr_html.tar.gz | |
path: /tmp | |
- name: Release | |
uses: marvinpinto/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: false | |
files: | | |
/tmp/crypto101-en.epub | |
/tmp/crypto101-en.pdf | |
/tmp/crypto101-en_html.tar.gz | |
/tmp/crypto101-fr.epub | |
/tmp/crypto101-fr.pdf | |
/tmp/crypto101-fr_html.tar.gz |