Skip to content

GHA: yes all secrets #46

GHA: yes all secrets

GHA: yes all secrets #46

name: Build Docker images
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published
jobs:
build:
name: Build and test Docker Image
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image for testing
uses: docker/build-push-action@v6
with:
push: false
tags: docker-erddap-test
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker
- name: Run Docker Image in Background
run: docker run -d -p 8080:8080 docker-erddap-test
- name: Check that ERDDAP Docker Image will return a 200
uses: ifaxity/wait-on-action@v1
timeout-minutes: 1
with:
resource: http://localhost:8080/erddap/index.html
- name: Checkout custom actions
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
- name: Publish Docker images
if: |
((github.event_name == 'release' && github.event.action == 'published') || github.ref == 'refs/heads/main')
&& github.repository == 'axiom-data-science/docker-erddap'
uses: ./.github/actions/publish_docker_image
with:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_PASSWORD }}