Exploring variables and secrets #5
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: Exploring variables and secrets | |
on: workflow_dispatch | |
# schedule: | |
# - cron: "*/1 * * * *" | |
env: | |
IMAGENAME: NGINX | |
CONTAINER_REGISTRY: docker.io | |
jobs: | |
Docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Docker build | |
run: echo docker build -t docker.io/${{ vars.DOCKERUSERNAME }}/$IMAGENAME:latest | |
- name: Docker login | |
run: echo docker login --username=${{ vars.DOCKERUSERNAME }} --password=${{ secrets.PASS }} | |
- name: Docker publish | |
run: echo docker push $CONTAINER_REGISTRY/${{ vars.DOCKERUSERNAME }}/$IMAGENAME:latest | |
Deploy: | |
needs: Docker | |
concurrency: | |
group: production-deployment | |
cancel-in-progress: true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Docker run | |
run: | | |
echo docker run -d -p 8080:80 $CONTAINER_REGISTRY/${{ vars.DOCKERUSERNAME }}/$IMAGENAME:latest | |
sleep 600s |