Skip to content

Commit

Permalink
Actions zip-files
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankBuchholz committed May 11, 2020
1 parent 53f50f4 commit a71a5b7
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/zip-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Archive files

on:
push:
paths-ignore:
- 'dist/**' # Do not trigger the action if the push request is triggered by this action itself
branches:
- master

jobs:
zip-files:
name: Archive files

if: github.repository == 'FrankBuchholz/EEP_convert_anl3_file'

runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v2

- name: Build
run: zip -u ./dist/EEP_convert_anl3_file.zip -i EEP_Gleisplan.html EEP_Inventar.html EEP_Signale.html EEP_Texts.js EEP_Signale_Daten.js

- name: Upload artifact # The artifact shows up at the action log
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/dist

- name: Commit # transfer the new zip file back into the repository
run: |
git config --local user.email "[email protected]" # dummy
git config --local user.name "GitHub Action" # or use ${{ github.actor }}
git add dist/EEP_convert_anl3_file.zip
git commit -m "Update dist/EEP_convert_anl3_file.zip"
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'master' # Destination branch to push changes, default=master
force: false # Determines if force push is used
tags: false # Determines if --tags is used

2 comments on commit a71a5b7

@FrankBuchholz
Copy link
Owner Author

@FrankBuchholz FrankBuchholz commented on a71a5b7 May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anscheinend gibt es kein Risiko einen Endlosschleife: Actions scheinen keinen Workflow triggern zu können.
Vorsichtshalber habe ich trotzdem paths-ignore eingefügt.

Alternativen zu ad-m/github-push-action:

@campersau
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja, das GitHub Actions keine weiteren GitHub Actions ausführen ist mir das erste Mal hier aufgefallen: peter-evans/create-pull-request#48
Allerdings war das für meinen Usecase eher hinderlich 😄

Bezüglich git push war das "früher" (vor einigen Monaten) anders, da hat das nämlich noch nicht funktioniert. Allerdings wurde das mit der Version 2 von actions/checkout gefixt.

Creates a local branch
No longer detached HEAD when checking out a branch
A local branch is created with the corresponding upstream branch set

Was auch in dieser Antwort kurz erwähnt wurde https://stackoverflow.com/a/58393457

Please sign in to comment.