Skip to content

Commit

Permalink
Build version image (#16)
Browse files Browse the repository at this point in the history
* feat: build/push da imagem docker do avaliador

* test version

* imp: separa workflows

* chore: faz push no Dockerhub ao invés do ECR
  • Loading branch information
Euclécio Josias Rodrigues authored Jan 7, 2022
1 parent e195e38 commit 42ca649
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and push image to Dockerhub
on:
workflow_dispatch:
inputs:
version:
description: "Versão do avaliador que você deseja fazer o build"
required: true
default: "latest"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.version }}

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: betrybe/jest-evaluator-action:${{ github.event.inputs.version }}
29 changes: 29 additions & 0 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and push image to Dockerhub on release
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Log in to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: betrybe/jest-evaluator-action:${{ env.RELEASE_VERSION }}
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ inputs:
pr_author_username:
description: 'Pull Request author username'
required: true

outputs:
result:
description: 'Jest unit tests JSON results in base64 format.'

runs:
using: 'docker'
image: 'Dockerfile'
Expand Down

0 comments on commit 42ca649

Please sign in to comment.