Merge pull request #113 from elisasre/dependency-update-1696653247 #51
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: | |
- self-hosted | |
- kaas | |
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 unittest | |
- name: Upload test coverage to codecov | |
uses: elisa-actions/codecov-action@v4-elisa | |
with: | |
url: https://codecov.csf.elisa.fi | |
- name: Lint | |
env: | |
GOLANGCI_LINT_FLAGS: --out-format=github-actions | |
run: mage lint | |
- name: Build binary | |
run: mage build | |
- name: Build image | |
run: mage image | |
- name: Push image | |
run: mage 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 |