diff --git a/.github/workflows/supermario.yml b/.github/workflows/supermario.yml new file mode 100644 index 0000000..69ebe69 --- /dev/null +++ b/.github/workflows/supermario.yml @@ -0,0 +1,29 @@ +name: Super Mario CI/CD + +on: + push: + branches: + - main + +jobs: + build_and_push: + runs-on: ubuntu-latest + + steps: + - name: Checkout do código + uses: actions/checkout@v3 + + - name: Login Docker Hub + run: | + echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USER }} --password-stdin + + - name: Build da imagem + run: | + docker build -t anacarvalho3006/supermario:${{ github.run_id }} . + docker tag anacarvalho3006/supermario:${{ github.run_id }} anacarvalho3006/supermario:latest + + + - name: Push da imagem para o Docker Hub + run: | + docker push anacarvalho3006/supermario:${{ github.run_id }} + docker push anacarvalho3006/supermario:latest