Add command to create the .cfg file #7
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: Build, Push and Deploy a Docker Image | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: # Allows for manual triggering | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build-push-deploy-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Create .cfg file | |
run: | | |
touch application.cfg | |
echo "${{secrets.ENV_CONTENT}}" >> application.cfg | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
id: push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./MavenBack | |
push: true | |
tags: | | |
ghcr.io/aleef02/pingpongpage:latest |