Skip to content

Commit

Permalink
Create deploy-dev.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
haahauge authored and GitHub Enterprise committed Mar 19, 2025
1 parent 8b86c2d commit 247fe12
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy to Development

on:
push:
branches:
- main

jobs:
deploy:
runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker image
run: |
# Build the Docker image and tag it with "latest"
docker build -t myapp:latest .
- name: Stop and remove existing container
run: |
# If there's an existing container, stop and remove it.
docker rm -f myapp_container || true
- name: Run Docker container
run: |
# Run the new container in detached mode, mapping port 80
docker run -d --name myapp_container -p 80:80 myapp:latest

0 comments on commit 247fe12

Please sign in to comment.