Added docker file and workflow #1
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: Build and Push Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4.2.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Build and push Docker image | |
| run: | | |
| docker build -t ghcr.io/${{ github.repository }}:latest . | |
| docker push ghcr.io/${{ github.repository }}:latest |