Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
artxia authored Apr 9, 2021
1 parent 2cf77e9 commit 2b8f26e
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,37 @@ on:
workflow_dispatch:
inputs:

env:
IMAGE_NAME: ehforwarderbot-docker

jobs:
build:
name: build
runs-on: ubuntu-latest
timeout-minutes: 5

steps:

- name: Checkout
uses: actions/checkout@v2

- name: build and push image
uses: docker/build-push-action@v1
timeout-minutes: 10

steps:
- name: Get the version
id: prep
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: artxia/ehforwarderbot-docker
tags: latest

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: ${{ startsWith(github.ref, 'refs/tags/') }}
tags: |
${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest
${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.prep.outputs.VERSION }}

0 comments on commit 2b8f26e

Please sign in to comment.