Update test.yml #103
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 Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
tags: ["v[0-9]+.[0-9]+.[0-9]*"] | |
jobs: | |
build: | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v3" | |
- name: "docker login" | |
uses: "docker/login-action@v2" | |
with: | |
username: ${{secrets.DOCKER_USER}} | |
password: ${{secrets.DOCKER_PASS}} | |
- name: "Build, Tag, and push the Docker image - latest" | |
if: ${{ github.ref_name == 'main' }} | |
env: | |
IMAGE_NAME: nsidc/noaadata-web-server-metrics | |
IMAGE_TAG: latest | |
run: | | |
docker build -t $IMAGE_NAME:$IMAGE_TAG . | |
docker push $IMAGE_NAME:$IMAGE_TAG | |
- name: "Build, Tag, and push the Docker image" | |
if: ${{ github.ref_name != 'main' }} | |
env: | |
IMAGE_NAME: nsidc/noaadata-web-server-metrics | |
IMAGE_TAG: ${{ github.ref_name }} | |
run: | | |
docker build -t $IMAGE_NAME:$IMAGE_TAG . | |
docker push $IMAGE_NAME:$IMAGE_TAG | |