remove root user #2
This file contains hidden or 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: Deploy to GitHub Container Registry | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write # Required to push to GitHub Container Registry | |
steps: | |
# Checkout the code | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
# Authenticate to GitHub Container Registry | |
- name: Log in to GitHub Container Registry | |
run: | | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin | |
# Build and tag the Docker image | |
- name: Build and Tag Docker Image | |
run: | | |
docker build -t node-javascript-mysql-demo . | |
docker tag node-javascript-mysql-demo:latest ghcr.io/${{ github.repository_owner }}/node-javascript-mysql-demo:latest | |
# Push the Docker image to GHCR | |
- name: Push Docker Image to GitHub Container Registry | |
run: | | |
docker push ghcr.io/${{ github.repository_owner }}/node-javascript-mysql-demo:latest |