🚀 Codebattles 3.2.0 is out! #5
Workflow file for this run
This file contains hidden or 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
| name: Build and Push Docker Images on Release | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 | |
| with: | |
| registry: codebattles.cr.cloud.ru | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: Pull images | |
| run: docker compose pull | |
| - name: (Latest) Build images | |
| run: docker compose build | |
| - name: (Latest) Push images | |
| run: docker compose push | |
| - name: Extract release tag | |
| id: extract_tag | |
| run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
| - name: (Release Tag) Build images | |
| run: docker compose build | |
| - name: (Release Tag) Push images | |
| run: docker compose push | |