-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (40 loc) · 1.27 KB
/
build-and-report.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: "Build Docker Image And Call Remote"
on:
push:
tags:
- v*
jobs:
build:
name: "Build Image"
runs-on: ubuntu-20.04
# These permissions are only necessary to read/publish to
# GitHub Container Registry, in other cases, it's dependent
# on the login permissions.
permissions:
contents: read
packages: write
steps:
- name: "Clone source repo"
uses: actions/checkout@v3
with:
path: 'source'
- name: "Generate random file"
run: echo foo-bar-$(date +%s) > source/generated.txt
- name: "Clone target repo"
uses: actions/checkout@v3
with:
path: 'target'
repository: gabizou/ActionsDummy-gen
token: ${{ secrets.REPO_TOKEN }}
- name: "Push file as new commit"
run: |
rm -rf target/generated.txt
cp source/generated.txt target
cd target
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions Bot"
git add generated.txt
git commit -m "Update generated files for ${GITHUB_REF_NAME}"
git tag -a "${GITHUB_REF_NAME}" -m \""${GITHUB_REF_NAME}"\"
git push origin main
git push -f origin "${GITHUB_REF_NAME}"