Skip to content

Merge pull request #29 from pcvg/SU-10203_Upgrade-Ruby-to-278 #124

Merge pull request #29 from pcvg/SU-10203_Upgrade-Ruby-to-278

Merge pull request #29 from pcvg/SU-10203_Upgrade-Ruby-to-278 #124

Workflow file for this run

name: Build and Publish
on: [push]
jobs:
lint:
name: Lint Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: npm i
- run: npm test
build_and_publish:
needs: lint
name: Build and publish Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build image
run: docker build -t gcp-ruby .
- name: Test Ruby
run: docker run gcp-ruby bash -c "which ruby || exit 1"
- name: Test Bundler
run: docker run gcp-ruby bash -c "which bundle || exit 1"
- name: Test Google Cloud SDK
run: docker run gcp-ruby bash -c "which gcloud || exit 1"
- name: Test Node.js
run: docker run gcp-ruby bash -c "which node || exit 1"
- name: Test Yarn
run: docker run gcp-ruby bash -c "which yarn || exit 1"
- name: Test Chrome
run: docker run gcp-ruby bash -c "which google-chrome || exit 1"
- name: Test Docker
run: docker run gcp-ruby bash -c "which docker || exit 1"
- name: Docker login
run: |
echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Publish latest
run: |
docker tag gcp-ruby savingsutd/gcp-ruby:latest &&
docker push savingsutd/gcp-ruby:latest
if: success() && github.ref == 'refs/heads/master'
- name: Publish release
run: |
export RELEASE_TAG=$(echo $GITHUB_REF | sed -e 's,.*/\(.*\),\1,') &&
docker tag gcp-ruby savingsutd/gcp-ruby:$RELEASE_TAG &&
docker push savingsutd/gcp-ruby:$RELEASE_TAG
if: success() && contains(github.ref, 'refs/tags')