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:20]
tomas [on sekce]
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á\\
 ==== root sekce ==== ==== root sekce ====
 ===on=== ===on===
-push.branches: -master, 'releases/**' ... nastavení push requestu v určitých GIT větvích\\+%%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 54: Line 63:
 concurency.cancel-in-progress: true\\ concurency.cancel-in-progress: true\\
  
 +===jobs===
  
-==== jobs ==== 
  
 ==== job ==== ==== job ====
Line 81: 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:\\
-with.path: ~/.m2\\+with.path: ~/.m2 ... ve kterém adresáři se cachuje. ~/.m2 pro maven, %%**%%/node_modules pro node\\ 
 %%with.key: ${{ runner.os }}-cache%% \\ %%with.key: ${{ runner.os }}-cache%% \\
 with.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\\