-
Notifications
You must be signed in to change notification settings - Fork 12
100 lines (90 loc) · 3.96 KB
/
update-child-repos.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# This is a basic workflow to help you get started with Actions
name: Update child repositories
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
update:
env:
GIT_USER: "[email protected]"
GIT_PASS: ${{ secrets.PUSH }}
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "CodeToCloud Workshop"
git config --global credential.helper "!f() { echo \`"username=`${GIT_USER}`npassword=`${GIT_PASS}\`"; }; f"
shell: pwsh
# Runs a set of commands using the runners shell
- name: Force update Source repo
run: |
mkdir $env:HOME/CodeToCloud-Source
cd $env:HOME/CodeToCloud-Source
git init
git remote add origin https://github.com/XpiritBV/CodeToCloud-Source.git
copy $env:GITHUB_WORKSPACE/Sources/* . -recurse -force
copy $env:GITHUB_WORKSPACE/.devcontainer . -recurse -force
copy $env:GITHUB_WORKSPACE/CONTRIBUTING.md .
git add .
git commit -m "Clean starter solution for Code-To-Cloud workshop"
git branch -M main
git push origin main --force
shell: pwsh
# Runs a set of commands using the runners shell
- name: Force update Student repo
run: |
mkdir $env:HOME/CodeToCloud-Student
cd $env:HOME/CodeToCloud-Student
git init
git remote add origin https://github.com/XpiritBV/CodeToCloud-Student.git
copy $env:GITHUB_WORKSPACE/Assets . -recurse -force
copy $env:GITHUB_WORKSPACE/Challenges . -recurse -force
remove-item -include @("start", "solution") * -Recurse -Force
copy $env:GITHUB_WORKSPACE/README-Student.md README.md
copy $env:GITHUB_WORKSPACE/CONTRIBUTING.md .
git add .
git commit -m "Code-To-Cloud workshop"
git branch -M main
git push origin main --force
shell: pwsh
- name: Force update Trainer repo
run: |
mkdir $env:HOME/CodeToCloud-Trainer
cd $env:HOME/CodeToCloud-Trainer
git init
git remote add origin https://github.com/XpiritBV/CodeToCloud-Trainer.git
copy $env:GITHUB_WORKSPACE/Assets . -recurse -force
copy $env:GITHUB_WORKSPACE/Challenges . -recurse -force
remove-item -include @("start", "solution") * -Recurse -Force
copy "$env:GITHUB_WORKSPACE/TrainerMaterials" . -recurse -force
copy $env:GITHUB_WORKSPACE/README-Trainer.md README.md
copy $env:GITHUB_WORKSPACE/CONTRIBUTING.md .
git add .
git commit -m "Code-To-Cloud workshop"
git branch -M main
git push origin main --force
shell: pwsh
- name: Force update Solution repo
run: |
mkdir $env:HOME/CodeToCloud-Solution
cd $env:HOME/CodeToCloud-Solution
git init
git remote add origin https://github.com/XpiritBV/CodeToCloud-Solution.git
copy $env:GITHUB_WORKSPACE/Challenges . -recurse -force
remove-item -include @("Step-by-Step") * -Recurse -Force
copy $env:GITHUB_WORKSPACE/README-Solution.md README.md
copy $env:GITHUB_WORKSPACE/CONTRIBUTING.md .
git add .
git commit -m "Code-To-Cloud workshop solutions"
git branch -M main
git push origin main --force
shell: pwsh