Merge pull request #324 from danesjenovdan/v3-dev #68
This file contains 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 publish Docker image | |
on: | |
push: | |
branches: | |
- v3-k8s | |
jobs: | |
push-to-registry: | |
name: Build and push Docker image to registry | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Scaleway | |
uses: docker/login-action@v2 | |
with: | |
registry: rg.fr-par.scw.cloud/djnd | |
username: nologin | |
password: ${{ secrets.SCW_SECRET_TOKEN }} | |
- name: Build and push DJND website | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: | | |
rg.fr-par.scw.cloud/djnd/danesjenovdan:${{ github.sha }} | |
rg.fr-par.scw.cloud/djnd/danesjenovdan:latest | |
- name: Build and push DJND website redirects | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./website-redirects | |
push: true | |
tags: | | |
rg.fr-par.scw.cloud/djnd/danesjenovdan-website-redirects:${{ github.sha }} | |
rg.fr-par.scw.cloud/djnd/danesjenovdan-website-redirects:latest | |
- name: Update image versions in kustomize/kustomization.yaml | |
run: | | |
sed -i "s/newTag: .*\+/newTag\: '${{ github.sha }}'/" kustomize/kustomization.yaml | |
- name: Commit and push new image versions | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: . | |
message: "Update image versions in kustomize/kustomization.yaml" |