From 739f8678a93796b7e6391afd3bbf3373c41afcf1 Mon Sep 17 00:00:00 2001 From: Mark McGarry Date: Fri, 1 Dec 2023 12:52:42 +0000 Subject: [PATCH] airship-3070: migrate to github actions --- .drone.yml | 40 -------------------------- .github/rvu/labels.yaml | 1 + .github/workflows/push.yaml | 57 +++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 40 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/rvu/labels.yaml create mode 100644 .github/workflows/push.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index a68bc8d..0000000 --- a/.drone.yml +++ /dev/null @@ -1,40 +0,0 @@ -workspace: - base: /go - path: src/github.com/uswitch/yggdrasil - -pipeline: - test: - image: golang:1.17 - environment: - - GO111MODULE=on - commands: - - make test - - build: - image: golang:1.17 - environment: - - GO111MODULE=on - commands: - - make build-linux - - docker-latest: - image: plugins/docker - repo: quay.io/uswitch/yggdrasil - registry: quay.io - secrets: [ docker_username, docker_password ] - tags: - - latest - - ${DRONE_COMMIT_SHA} - when: - event: push - branch: master - - docker-tagged: - image: plugins/docker - repo: quay.io/uswitch/yggdrasil - registry: quay.io - secrets: [ docker_username, docker_password ] - tags: - - ${DRONE_TAG} - when: - event: tag diff --git a/.github/rvu/labels.yaml b/.github/rvu/labels.yaml new file mode 100644 index 0000000..7b192d6 --- /dev/null +++ b/.github/rvu/labels.yaml @@ -0,0 +1 @@ +service.rvu.co.uk/brand: airship diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 0000000..5261227 --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,57 @@ +name: push +on: push +permissions: + contents: read + id-token: write +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: "1.17" + - run: make test + build: + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: "1.17" + - run: make build-linux + - uses: actions/upload-artifact@v3 + with: + name: bin + path: bin/ + docker-latest: + if: github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/v') + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: bin + path: bin/ + - name: Login to Quay.io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + - id: meta + uses: docker/metadata-action@v5 + with: + images: quay.io/uswitch/yggdrasil + tags: | + type=semver,pattern={{version}} + type=sha,prefix=,format=long, + - uses: docker/build-push-action@v5 + with: + context: . + labels: ${{ steps.meta.outputs.labels }} + push: true + tags: ${{ steps.meta.outputs.tags }} +