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: push | ||
# 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: | ||
if: github.ref == "refs/heads/main" | ||
Check failure on line 22 in .github/workflows/variable-secrets.yaml GitHub Actions / Exploring variables and secretsInvalid workflow file
|
||
needs: Docker | ||
concurrency: | ||
group: production-deployment | ||
cancel-in-progress: false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Docker run | ||
timeout-minutes: 1 | ||
run: | | ||
echo docker run -d -p 8080:80 $CONTAINER_REGISTRY/${{ vars.DOCKERUSERNAME }}/$IMAGENAME:latest | ||
sleep 600s |