Skip to content

Exploring variables and secrets #5

Exploring variables and secrets

Exploring variables and secrets #5

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