diff --git a/.github/workflows/build_containers.yaml b/.github/workflows/build_containers.yaml new file mode 100644 index 0000000..b206821 --- /dev/null +++ b/.github/workflows/build_containers.yaml @@ -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 + diff --git a/.github/workflows/main_build.yaml b/.github/workflows/main_build.yaml new file mode 100644 index 0000000..cfbdea4 --- /dev/null +++ b/.github/workflows/main_build.yaml @@ -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