Skip to content

Commit

Permalink
Merge pull request #130 from uswitch/AIRSHIP-3064-gha-migration
Browse files Browse the repository at this point in the history
AIRSHIP-3064 GHA migration
  • Loading branch information
meghaniankov authored Jan 8, 2024
2 parents d9cfd20 + e4c4008 commit f531393
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 48 deletions.
48 changes: 0 additions & 48 deletions .drone.yml

This file was deleted.

67 changes: 67 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: push

on: push

permissions:
contents: read
id-token: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.2.2
- run: bundle install
- run: rake spec

build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.2.2
- run: rake version
- run: rake build
- uses: actions/upload-artifact@v3
with:
name: pkg
path: pkg/

docker:
needs: build
runs-on: ubuntu-latest
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
steps:
- uses: actions/checkout@v4
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- uses: actions/download-artifact@v3
with:
name: pkg
path: pkg/
- id: meta
uses: docker/metadata-action@v4
with:
images: quay.io/uswitch/terrafying
tags: |
type=sha,prefix=,format=long
type=semver,pattern={{version}}
- uses: docker/build-push-action@v4
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: "TERRAFYING_VERSION=${{ contains(github.ref, 'refs/tags/') && github.ref_name || '0.0.0' }}"
23 changes: 23 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: tag

on:
push:
tags:
- '*'

permissions:
contents: read
id-token: write

jobs:
push:
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.2.2
- run: rake push

0 comments on commit f531393

Please sign in to comment.