Skip to content

Commit

Permalink
Merge pull request #2 from vulcanize/ci-fix
Browse files Browse the repository at this point in the history
Fix Github Actions
  • Loading branch information
ramilexe authored Jun 16, 2021
2 parents d25eb9f + c2769fd commit 3a574e3
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 65 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/on-main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test and build

on:
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:ganache &
- run: npm run test:start &
- run: sleep 10 && npm test
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get the version
id: vars
run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7})
- name: Run docker build
run: docker build -t vulcanize/testing-framework -f Dockerfile .
- name: Tag docker image
run: docker tag vulcanize/testing-framework docker.pkg.github.com/vulcanize/testing-framework/testing-framework:${{steps.vars.outputs.sha}}
- name: Docker Login
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin
- name: Docker Push
run: docker push docker.pkg.github.com/vulcanize/testing-framework/testing-framework:${{steps.vars.outputs.sha}}
32 changes: 32 additions & 0 deletions .github/workflows/on-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test and build

on:
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run test:ganache &
- run: npm run test:start &
- run: sleep 10 && npm test
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get the version
id: vars
run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7})
- name: Run docker build
run: docker build -t vulcanize/testing-framework -f Dockerfile .
27 changes: 27 additions & 0 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish docker image

on:
release:
types: [ published ]

jobs:

release:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Get the version
id: vars
run: |
echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7})
echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})
- name: Docker Login to Github Registry
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin
- name: Docker Pull
run: docker pull docker.pkg.github.com/vulcanize/testing-framework/testing-framework:${{steps.vars.outputs.sha}}
- name: Docker Login to Docker Registry
run: echo ${{ secrets.VULCANIZEJENKINS_PAT }} | docker login -u vulcanizejenkins --password-stdin
- name: Tag docker image
run: docker tag docker.pkg.github.com/vulcanize/testing-framework/testing-framework:${{steps.vars.outputs.sha}} vulcanize/testing-framework:${{steps.vars.outputs.tag}}
- name: Docker Push to Docker Hub
run: docker push vulcanize/testing-framework:${{steps.vars.outputs.tag}}
65 changes: 0 additions & 65 deletions .github/workflows/workflow.yaml

This file was deleted.

0 comments on commit 3a574e3

Please sign in to comment.