Force new build with correct tag #4
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: Nodejs CD to Docker Hub | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout kode | |
| uses: actions/checkout@v4 | |
| # 1. Login ke Docker Hub menggunakan Secrets yang tadi dibuat | |
| - name: Login ke Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # 2. Build dan Push otomatis | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| # Ganti 'usernameanda' dengan username Docker Hub Anda yang asli | |
| tags: sug1anto/nodejs1b:latest |