Skip to content

Commit

Permalink
Adding build action
Browse files Browse the repository at this point in the history
  • Loading branch information
zcobell committed Sep 20, 2023
1 parent 0bfc2f6 commit 7f4815a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build_containers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build Containers Workflow Template
on:
workflow_call:
inputs:
tag:
required: true
type: string
secrets:
DOCKER_LOGIN_USERNAME:
required: true
DOCKER_LOGIN_TOKEN:
required: true

jobs:
build-container:
name: Build adcirc-ci-container
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

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

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

- name: Login to DockerHub
run: echo ${{ secrets.DOCKER_LOGIN_TOKEN }} | docker login -u ${{ secrets.DOCKER_LOGIN_USERNAME }} --password-stdin

- name: Build and push adcirc-ci-container Docker image
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64
tags: zcobell/adcirc-ci-container:${{ inputs.tag }}
labels: org.adcirc.adcirc-ci-container

12 changes: 12 additions & 0 deletions .github/workflows/main_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Main branch build
on:
push:
branches:
- main

jobs:
main-build-and-deploy:
uses: ./.github/workflows/build_containers.yaml
with:
tag: latest
secrets: inherit

0 comments on commit 7f4815a

Please sign in to comment.