add docker hub push ci #15
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: Push Docker image to Github Packages (GHCR) | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
GHCR-packaging: | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Docker image | |
run: docker build -t ghcr.io/sunny-unik/node-in-docker . | |
- name: Login to GitHub Container Registry | |
run: docker login ghcr.io -u Sunny-unik --password ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Docker image to GHCR | |
run: docker push ghcr.io/sunny-unik/node-in-docker | |
docker-hub-packaging: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Docker image | |
run: docker build -t sunnyunik/node-in-ubuntu:latest | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push Docker image to Docker Hub | |
run: docker push sunnyunik/node-in-ubuntu:latest |