-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53f50f4
commit a71a5b7
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
a71a5b7
There was a problem hiding this comment.
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:
Hier scheint es direkt zu funktionieren:
https://stackoverflow.com/questions/57921401/push-to-origin-from-github-action
https://peterevans.dev/posts/github-actions-how-to-automate-code-formatting-in-pull-requests/
a71a5b7
There was a problem hiding this comment.
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 vonactions/checkout
gefixt.Was auch in dieser Antwort kurz erwähnt wurde https://stackoverflow.com/a/58393457