Adding in templates for ginsburg build. #4863
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker container | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- master | |
tags: | |
- v* | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Setup docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: medbha | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- run: 'echo "$SPEC_ACCESS" > ci/github_key' | |
shell: bash | |
env: | |
SSH_KEY: ${{ secrets.SPEC_ACCESS }} | |
- name: Step to get tag name | |
id: vars | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
if: ${{ startsWith(github.ref, 'refs/heads') && github.ref == 'refs/heads/master' }} | |
with: | |
context: ci | |
file: ci/Dockerfile.ubuntu | |
push: true | |
tags: hiddensymmetries/simsopt:latest | |
- name: Build for branches | |
uses: docker/build-push-action@v2 | |
if: ${{ startsWith(github.ref, 'refs/heads') && github.ref != 'refs/heads/master' }} | |
with: | |
context: ci | |
file: ci/Dockerfile.ubuntu | |
push: false | |
tags: hiddensymmetries/simsopt:test | |
- name: Build and push for tag | |
uses: docker/build-push-action@v2 | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
with: | |
context: ci | |
file: ci/Dockerfile.ubuntu | |
push: true | |
tags: "hiddensymmetries/simsopt:${{steps.vars.outputs.tag}}" |