iso_build #97
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: iso_build | |
on: | |
workflow_dispatch: | |
# schedule: | |
# - cron: '30 2 * * *' | |
jobs: | |
prepare-release: | |
runs-on: elarch-builder | |
steps: | |
- name: Allow workflow to be cancelled | |
uses: styfle/cancel-workflow-action@0.9.0 | |
with: | |
access_token: ${{ github.token }} | |
- name: Get time | |
id: time | |
uses: nanzm/get-time-action@v1.1 | |
with: | |
format: 'DDMMYYYYHHmm' | |
outputs: | |
release_tag: ${{ steps.time.outputs.time }} | |
build-release: | |
runs-on: elarch-builder | |
needs: [prepare-release] | |
permissions: | |
contents: write | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
root-reserve-mb: 30720 | |
swap-size-mb: 4096 | |
remove-dotnet: 'true' | |
remove-android: 'true' | |
remove-haskell: 'true' | |
remove-codeql: 'true' | |
- name: Create output directory | |
run: | | |
mkdir -p isoOUT | |
chmod 777 isoOUT | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Run Docker builder | |
uses: pl-strflt/docker-container-action@v1 | |
with: | |
repository: evangelospro/dotfiles | |
ref: main | |
opts: --network=host --privileged -v "$(pwd)/isoOUT/":/home/builder/iso/isoOUT | |
dockerfile: Dockerfile | |
- name: List files | |
run: | | |
pwd | |
ls -lasih isoOUT | |
- name: Upload Releases only if build was successful | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ needs.prepare-release.outputs.release_tag }} | |
files: | | |
isoOUT/*.part* | |
isoOUT/*.sha256 | |
isoOUT/*.txt | |
fail_on_unmatched_files: true | |
- name: Rollback | |
if: ${{ failure() || cancelled() }} | |
run: | | |
echo ${{ github.token }} | gh auth login --with-token | |
gh release delete ${{ needs.prepare-release.outputs.release_tag }} -y --repo ${{ github.repository }} |