Skip to content
Snippets Groups Projects
Unverified Commit c54e7eb9 authored by Joel Takvorian's avatar Joel Takvorian Committed by GitHub
Browse files

Upgrade github actions (#89)

* Upgrade github actions

* Update actions/github-script@v6
parent 1db7150f
No related branches found
No related tags found
No related merge requests found
...@@ -11,9 +11,9 @@ jobs: ...@@ -11,9 +11,9 @@ jobs:
name: test name: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: 1.18 go-version: 1.18
- name: Install make - name: Install make
......
...@@ -15,11 +15,11 @@ jobs: ...@@ -15,11 +15,11 @@ jobs:
- name: install make - name: install make
run: sudo apt-get install make run: sudo apt-get install make
- name: set up go 1.x - name: set up go 1.x
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: 1.18 go-version: 1.18
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: run end-to-end tests - name: run end-to-end tests
run: make tests-e2e run: make tests-e2e
- name: upload e2e test logs - name: upload e2e test logs
......
...@@ -22,11 +22,11 @@ jobs: ...@@ -22,11 +22,11 @@ jobs:
- name: install make - name: install make
run: sudo apt-get install make run: sudo apt-get install make
- name: set up go 1.x - name: set up go 1.x
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: build images - name: build images
run: make ci-images-build run: make ci-images-build
- name: podman login to quay.io - name: podman login to quay.io
...@@ -36,14 +36,13 @@ jobs: ...@@ -36,14 +36,13 @@ jobs:
password: ${{ env.REGISTRY_PASSWORD }} password: ${{ env.REGISTRY_PASSWORD }}
registry: quay.io registry: quay.io
- name: get short sha - name: get short sha
id: shortsha run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
- name: push to quay.io - name: push to quay.io
id: push-to-quay id: push-to-quay
uses: redhat-actions/push-to-registry@v2 uses: redhat-actions/push-to-registry@v2
with: with:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
tags: ${{ env.TAGS }} ${{ steps.shortsha.outputs.short_sha }} tags: ${{ env.TAGS }} ${{ env.short_sha }}
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
- name: print image url - name: print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
\ No newline at end of file
...@@ -13,7 +13,7 @@ jobs: ...@@ -13,7 +13,7 @@ jobs:
push-pr-image: push-pr-image:
if: ${{ github.event.label.name == 'ok-to-test' }} if: ${{ github.event.label.name == 'ok-to-test' }}
name: push PR image name: push PR image
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
go: ['1.18'] go: ['1.18']
...@@ -21,11 +21,11 @@ jobs: ...@@ -21,11 +21,11 @@ jobs:
- name: install make - name: install make
run: sudo apt-get install make run: sudo apt-get install make
- name: set up go 1.x - name: set up go 1.x
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
ref: "refs/pull/${{ github.event.number }}/merge" ref: "refs/pull/${{ github.event.number }}/merge"
- name: build images - name: build images
...@@ -37,16 +37,15 @@ jobs: ...@@ -37,16 +37,15 @@ jobs:
password: ${{ secrets.QUAY_SECRET }} password: ${{ secrets.QUAY_SECRET }}
registry: quay.io registry: quay.io
- name: get short sha - name: get short sha
id: shortsha run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
- name: push to quay.io - name: push to quay.io
id: push-to-quay id: push-to-quay
uses: redhat-actions/push-to-registry@v2 uses: redhat-actions/push-to-registry@v2
with: with:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
tags: ${{ steps.shortsha.outputs.short_sha }} tags: ${{ env.short_sha }}
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
- uses: actions/github-script@v5 - uses: actions/github-script@v6
with: with:
github-token: ${{secrets.GITHUB_TOKEN}} github-token: ${{secrets.GITHUB_TOKEN}}
script: | script: |
......
...@@ -19,15 +19,14 @@ jobs: ...@@ -19,15 +19,14 @@ jobs:
go: ['1.18'] go: ['1.18']
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: validate tag - name: validate tag
id: validate_tag
run: | run: |
tag=`git describe --exact-match --tags 2> /dev/null` tag=`git describe --exact-match --tags 2> /dev/null`
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then
echo "$tag is a valid release tag" echo "$tag is a valid release tag"
set -e set -e
echo "::set-output name=tag::$tag" echo "tag=$tag" >> $GITHUB_ENV
else else
echo "$tag is NOT a valid release tag" echo "$tag is NOT a valid release tag"
exit 1 exit 1
...@@ -35,11 +34,11 @@ jobs: ...@@ -35,11 +34,11 @@ jobs:
- name: install make - name: install make
run: sudo apt-get install make run: sudo apt-get install make
- name: set up go 1.x - name: set up go 1.x
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: ${{ matrix.go }} go-version: ${{ matrix.go }}
- name: build images - name: build images
run: SW_VERSION="${{ steps.validate_tag.outputs.tag }}" make image-build run: SW_VERSION="${{ env.tag }}" make image-build
- name: podman login to quay.io - name: podman login to quay.io
uses: redhat-actions/podman-login@v1 uses: redhat-actions/podman-login@v1
with: with:
...@@ -51,7 +50,7 @@ jobs: ...@@ -51,7 +50,7 @@ jobs:
uses: redhat-actions/push-to-registry@v2 uses: redhat-actions/push-to-registry@v2
with: with:
image: ${{ env.IMAGE }} image: ${{ env.IMAGE }}
tags: ${{ steps.validate_tag.outputs.tag }} tags: ${{ env.tag }}
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
- name: print image url - name: print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment