Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
automatizace:github [2023/06/02 15:05]
tomas [Kroky, steps]
automatizace:github [2023/12/21 12:20] (current)
tomas [root sekce]
Line 1: Line 1:
 +====Runner====
 +
 +%%VERSION=2.311.0 curl -o actions-runner.tar.gz -L "https://github.com/actions/runner/releases/download/v${VERSION}/actions-runner-linux-x64-${VERSION}.tar.gz"%%\\
 +tar xzf ./actions-runner-linux.tar.gz && rm ./actions-runner-linux.tar.gz \\
 +%%./config.sh --url https://github.com/VFCZ-Digital/cicd-automation --token XXXX --runnergroup '' --name runner-1 --unattended --labels aws --replace%%\\
 +sudo ./svc.sh install ... instalace služby\\
 +sudo ./svc.sh start ... spuštění služby\\
 +
 +
 ==== Struktura ==== ==== Struktura ====
 definuje se v .github/workflows, napr. build_workflow.yml definuje se v .github/workflows, napr. build_workflow.yml
Line 26: Line 35:
 ==== Proměnné ==== ==== Proměnné ====
 %%${{runner.os}}%%\\ %%${{runner.os}}%%\\
- +%%${{matrix.version}}%% ... provede krok několikrát, doplní data ze sekce matrix pro každý běh jiná\\ 
-==== on sekce ==== +==== root sekce ==== 
-push.branches: -master, 'releases/**' ... nastavení push requestu v určitých GIT větvích\\+===on=== 
 +%%push.branches: -master, 'releases/**'%% ... nastavení push requestu v určitých GIT větvích\\
 pull_request.branches: - master, develop ... pull requesty\\ pull_request.branches: - master, develop ... pull requesty\\
-workflow_dispach: ... \\+workflow_dispach: ... manuální spouštění\\
  
 === workflow_call === === workflow_call ===
Line 47: Line 57:
 workflow_call.outputs.PRVNI.value: %%${{ job.EXAMPLE.outputs.output1 }}%% workflow_call.outputs.PRVNI.value: %%${{ job.EXAMPLE.outputs.output1 }}%%
  
-==== jobs ====+===concurency===  
 +běh na více prostředích 
 + 
 +%%concurency.group: environment-${{github.ref}}%%\\ 
 +concurency.cancel-in-progress: true\\ 
 + 
 +===jobs=== 
  
 ==== job ==== ==== job ====
Line 73: Line 90:
 == run == == run ==
 spustí příkaz\\ spustí příkaz\\
 +
 +== github ==
 +run: gh repo list aaa
 +env.GITHUB_TOKEN: %%${{secrets.token}}%%
  
 == actions/cache == == actions/cache ==
-uses: actions/cache@v1.2.1 +uses: actions/cache@v1.2.1\\ 
-with +with:\\ 
-  path: ~/.m2\\ +with.path: ~/.m2 ... ve kterém adresáři se cachuje. ~/.m2 pro maven, %%**%%/node_modules pro node\\  
-%%  key: ${{ runner.os }}-cache%% \\ +%%with.key: ${{ runner.os }}-cache%% \\ 
-  restore-keys: ""\\+with.restore-keys: ""\\
      
 == actions/checkout == == actions/checkout ==
 +
 == actions/setup-node@v3 == == actions/setup-node@v3 ==
 +with.node-version: '16'
 +with.registry-url: https://registry.npmjs.org/
 +
 == actions/setup-java == == actions/setup-java ==
 with.java-version: '11'\\ with.java-version: '11'\\
 with.distribution: 'temurin'\\ with.distribution: 'temurin'\\
 with.cache: 'maven'\\ with.cache: 'maven'\\
 +
 +== docker/setup-buildx-action ==
 +
 +== docker/login-action ==
 +with.username: %%${{ secrets.DOCKER_USR }}%%\\
 +with.password: %%${{ secrets.DOCKER_PWD }}%%\\
 +
 +== docker/build-and-push ==
 +with.context: .\\
 +with.push: true\\
 +with.tags: aa/bb:cc\\