Merge pull request #134 from elisasre/dependency-update-1699418104 #57
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: Deploy CI | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: elisa-normal | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: elisa-actions/setup-go-and-mage@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_TOKEN }} | |
- name: Run unit tests | |
run: mage go:unittest | |
- name: Upload test coverage to codecov | |
uses: elisa-actions/codecov-action@v4-elisa | |
with: | |
url: https://codecov.csf.elisa.fi | |
- name: Lint | |
run: mage go:lint | |
- name: Vuln check | |
run: mage go:vulncheck | |
- name: Build binary | |
run: mage go:build | |
- name: Build image | |
env: | |
DOCKER_IMAGE_TAGS: sha-${{ github.sha }} | |
run: mage docker:image | |
- name: Push image | |
run: mage docker:pushImage | |
- name: Update batch | |
env: | |
GH_TOKEN: ${{ secrets.DOPS_SRE_PAT }} | |
GH_ORG: elisasre | |
GH_REPO: batch | |
REPLACE_REGEX: (quay.io/elisaoyj/networkpolicy-controller:sha-)(.*) | |
COMMIT_TEXT: update networkpolicy-controller image to {{.SHA}} | |
FILE_PATH: templates/go/core/networkpolicy-controller/latest.yaml | |
run : | | |
curl -s https://${{ secrets.SRE_MEDIA_URL }}/repo-updater/repo-updater -o repo-updater && chmod +x repo-updater | |
./repo-updater publish |