Initial workflow
/ build_and_test (pull_request) Failing after 3s Details

pull/1/head
jhot 2023-09-15 12:06:34 -06:00
parent 7c61f09817
commit 8742333dd3
Signed by: jhot
GPG Key ID: 612ED70E22571DD4
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
on:
push:
branches:
- main
tags:
- v[0-9]*
pull_request:
branches:
- main
jobs:
build_and_test:
runs_on: docker
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker metadata
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: name/app
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: https://github.com/docker/login-action@v3
with:
registry: code.jhot.me
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}