Merge pull request #234 from elisasre/dependabot/go_modules/golang.or… #137
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 Google Artifact Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: europe-north1-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GAR_JSON_KEY }} | |
- name: Run unit tests | |
run: mage go:unittest | |
- name: Upload test coverage to codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
url: https://codecov.csf.elisa.fi | |
flags: unit | |
files: ./target/tests/cover/unit/cover.txt | |
use_oidc: true | |
- name: Lint | |
run: mage go:lint | |
- name: Build binary | |
run: mage go:build | |
- name: Build image | |
env: | |
DOCKER_IMAGE_TAGS: sha-${{ github.sha }} | |
run: mage docker:build | |
- name: Push image | |
run: mage docker:push | |
- name: Update batch | |
env: | |
GH_TOKEN: ${{ secrets.DOPS_SRE_PAT }} | |
GH_ORG: elisasre | |
GH_REPO: batch | |
REPLACE_REGEX: (europe-north1-docker.pkg.dev/sose-sre-5737/sre-public/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 |