Skip to content

Commit

Permalink
docs: README
Browse files Browse the repository at this point in the history
  • Loading branch information
owojcikiewicz committed Mar 10, 2024
1 parent b06d331 commit 59d5ef9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### Deploy Action

GitHub Action for deploying stacks to [Portainer](https://portainer.io).

### Usage

To use this action, simply create a workflow in `.github/workflows` and use it:

```yaml
name: Deploy

on:
push:
branches: [main, develop]

env:
ENVIRONMENT: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}
IMAGE_PATH: docker/${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
uses: saturdayshdev/deploy-action@v1.0.0
with:
portainer-url: ${{ secrets.PORTAINER_URL }}
portainer-username: ${{ secrets.PORTAINER_USERNAME }}
portainer-password: ${{ secrets.PORTAINER_PASSWORD }}
portainer-endpoint-id: ${{ vars.PORTAINER_ENDPOINT }}
env-file: ${{ vars.ENVFILE }}
stack-name: ${{ env.ENVIRONMENT }}-${{ github.event.repository.name }}
stack-compose-path: ${{ env.IMAGE_PATH }}/docker-compose.yml
stack-pull-image: true
stack-prune: true
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Deploy
description: 🏗️ GitHub Action for deploying to Portainer.
description: 🏗️ GitHub Action for deploying stacks to Portainer.

inputs:
portainer-url:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@saturdayshdev/deploy-action",
"version": "1.0.0",
"description": "🏗️ GitHub Action for deploying to Portainer.",
"description": "🏗️ GitHub Action for deploying stacks to Portainer.",
"main": "dist/index.js",
"scripts": {
"build": "ncc build src/action.ts --source-map --out dist"
Expand Down

0 comments on commit 59d5ef9

Please sign in to comment.