Add GitHub action

This commit is contained in:
Aram 🍐 2023-07-21 20:33:08 -04:00
parent f64a55b206
commit 7a6e28023d
2 changed files with 56 additions and 0 deletions

21
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,21 @@
on: [push, pull_request]
name: Build
jobs:
build:
name: build
runs-on: ubuntu-latest
env:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Build Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: false
tags: dev

35
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,35 @@
name: release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build-release:
name: build-release
runs-on: ubuntu-latest
env:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: aramperes/ts-activity
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}