Skip to content

Commit

Permalink
Merge pull request kubenav#288 from kubenav/update-github-actions
Browse files Browse the repository at this point in the history
Update GitHub Actions
  • Loading branch information
ricoberger authored Dec 21, 2020
2 parents 7d1df67 + 4971213 commit 507b414
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
build:
name: Build
runs-on: macos-latest
runs-on: macos-11.0
steps:
- name: Get Version
id: get_version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
changelog:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: Generate Changelog
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

strategy:
fail-fast: false
Expand Down
44 changes: 18 additions & 26 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
docker:
name: Docker
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -28,32 +28,24 @@ jobs:
echo ::set-output name=tag::${DOCKER_TAG}
- name: Docker Buildx (prepare)
id: prepare
run: |
DOCKER_IMAGE=kubenav/kubenav
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --tag ${DOCKER_IMAGE}:${{ steps.tag.outputs.tag }} --file cmd/server/Dockerfile .
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3

- name: Docker Buildx (build)
run: |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
- name: Docker Login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
uses: docker/setup-buildx-action@v1

- name: Docker Buildx (push)
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Clear
if: ${{ always() }}
run: |
rm -f ${HOME}/.docker/config.json
- name: Build and Push Docker Image
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
context: .
file: ./cmd/server/Dockerfile
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
tags: kubenav/kubenav:${{ steps.tag.outputs.tag }}
6 changes: 3 additions & 3 deletions .github/workflows/mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-20.04, macos-11.0]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -21,15 +21,15 @@ jobs:
- name: Generate Bindings (Android)
# We must build the Android bindings on Ubuntu,
# because the macOS used for GitHub Actions contains an outdated NDK version.
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-20.04'
run: |
go get golang.org/x/mobile/cmd/gomobile
go install golang.org/x/mobile/cmd/gomobile
gomobile init
make bindings-android
- name: Generate Bindings (iOS)
if: matrix.os == 'macos-latest'
if: matrix.os == 'macos-11.0'
# We must unset the ANDROID_HOME and ANDROID_NDK_HOME environment variables,
# otherwise gomobile tries to generate the bindings for Android.
run: |
Expand Down

0 comments on commit 507b414

Please sign in to comment.