Skip to content

Commit

Permalink
Merge pull request #84 from nomad-nmr/actions
Browse files Browse the repository at this point in the history
Actions finished
  • Loading branch information
tomlebl authored May 1, 2024
2 parents 095468f + b6b632d commit c3f0ff0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
name: Publish Docker Image
on:
release:
types: [published]
workflow_dispatch:
push:
tags: [dev-latest, production]
inputs:
tag:
description: 'Docker image tag'
required: true
default: 'latest'
type: choice
options:
- dev-latest
- production
# push:
# tags: [dev-latest, production]
jobs:
test_api:
name: Run automatic test for API
uses: ./.github/workflows/test-api.yml
push_to_hub:
name: Push Docker image to Docker Hub
name: Build and push Docker images
needs: test_api
strategy:
matrix:
include:
- image: nomadnmr/server
dockerfile: ./Dockerfile.serv
- image: nomadnmr/server-tls
dockerfile: ./Dockerfile.serv-tls
- image: nomadnmr/api
dockerfile: ./Dockerfile.api
runs-on: ubuntu-latest
steps:
- name: Get code
Expand All @@ -21,16 +45,17 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: nomadnmr/server
images: ${{matrix.image}}
tags: |
type=ref,event=tag
type=sha
type=raw,value=${{inputs.tag}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.serv
file: ${{matrix.dockerfile}}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
14 changes: 7 additions & 7 deletions .github/workflows/test-api.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Test API
on:
workflow_dispatch
# push:
# branches:
# - 'main'
# pull_request:
# types:
# - opened
workflow_call:
push:
branches:
- 'main'
pull_request:
types:
- opened
jobs:
test:
env:
Expand Down

0 comments on commit c3f0ff0

Please sign in to comment.