Skip to content

Commit 1dae9f6

Browse files
committed
Add Mirror
1 parent a87dc26 commit 1dae9f6

File tree

3 files changed

+93
-44
lines changed

3 files changed

+93
-44
lines changed

.github/workflows/mirror.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Mirror"
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: ["published"]
7+
push:
8+
branches: ["**"]
9+
tags: ["**"]
10+
11+
jobs:
12+
mirror:
13+
name: "Mirror"
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 5
16+
17+
steps:
18+
- name: "Checkout"
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: "Mirror to Codeberg"
24+
uses: cssnr/mirror-repository-action@master
25+
with:
26+
host: https://codeberg.org
27+
create: true
28+
username: "shaner"
29+
password: ${{ secrets.CODEBERG_TOKEN }}

.prettierrc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"trailingComma": "es5",
3+
"semi": false,
4+
"singleQuote": true,
5+
"overrides": [
6+
{
7+
"files": ["**/*.json", "**/*.yaml", "**/*.yml"],
8+
"options": {
9+
"singleQuote": false
10+
}
11+
},
12+
{
13+
"files": ["**/*.json", "**/*.yaml", "**/*.yml"],
14+
"options": {
15+
"tabWidth": 2
16+
}
17+
}
18+
]
19+
}

README.md

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,84 +2,84 @@
22
[![Test](https://img.shields.io/github/actions/workflow/status/cssnr/stack-deploy-action/test.yaml?logo=github&logoColor=white&label=test)](https://github.com/cssnr/stack-deploy-action/actions/workflows/test.yaml)
33
[![GitHub Release Version](https://img.shields.io/github/v/release/cssnr/stack-deploy-action?logo=github)](https://github.com/cssnr/stack-deploy-action/releases/latest)
44
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/parse-issue-form-action?logo=github&logoColor=white&label=updated)](https://github.com/cssnr/parse-issue-form-action/graphs/commit-activity)
5+
[![Codeberg Last Commit](https://img.shields.io/gitea/last-commit/cssnr/parse-issue-form-action/master?gitea_url=https%3A%2F%2Fcodeberg.org%2F&logo=codeberg&logoColor=white&label=updated)](https://codeberg.org/cssnr/parse-issue-form-action)
56
[![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/stack-deploy-action?logo=htmx&logoColor=white)](https://github.com/cssnr/stack-deploy-action)
67
[![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat&logo=github&logoColor=white)](https://cssnr.github.io/)
78
[![Discord](https://img.shields.io/discord/899171661457293343?logo=discord&logoColor=white&label=discord&color=7289da)](https://discord.gg/wXy6m2X8wY)
89

910
# Docker Stack Deploy Action
1011

11-
This action deploys a docker stack from a compose file to a remote docker host using SSH Password or Key File
12-
Authentication.
12+
This action deploys a docker stack from a compose file to a remote docker host using SSH Password or Key File Authentication.
1313

1414
For more details see [action.yaml](action.yaml) and [src/main.sh](src/main.sh).
1515

16-
* [Inputs](#Inputs)
17-
* [Examples](#Examples)
18-
* [Support](#Support)
19-
* [Contributing](#Contributing)
16+
- [Inputs](#Inputs)
17+
- [Examples](#Examples)
18+
- [Support](#Support)
19+
- [Contributing](#Contributing)
2020

2121
## Inputs
2222

23-
| input | required | default | description |
24-
|----------|----------|-----------------------|--------------------------|
25-
| host | **Yes** | - | Remote Docker hostname |
26-
| port | No | `22` | Remote Docker port |
27-
| user | **Yes** | - | Remote Docker username |
28-
| pass | No | - | Remote Docker password * |
29-
| ssh_key | No | - | Remote SSH Key file * |
30-
| file | No | `docker-compose.yaml` | Docker Compose file |
31-
| name | **Yes** | - | Docker Stack name |
32-
| env_file | No | - | Docker Environment file |
23+
| input | required | default | description |
24+
| -------- | -------- | --------------------- | ------------------------- |
25+
| host | **Yes** | - | Remote Docker hostname |
26+
| port | No | `22` | Remote Docker port |
27+
| user | **Yes** | - | Remote Docker username |
28+
| pass | No | - | Remote Docker password \* |
29+
| ssh_key | No | - | Remote SSH Key file \* |
30+
| file | No | `docker-compose.yaml` | Docker Compose file |
31+
| name | **Yes** | - | Docker Stack name |
32+
| env_file | No | - | Docker Environment file |
3333

3434
**pass/ssh_key** - You must provide either a `pass` or `ssh_key`
3535

3636
```yaml
37-
- name: "Docker Stack Deploy"
38-
uses: cssnr/stack-deploy-action@v1
39-
with:
40-
host: ${{ secrets.DOCKER_HOST }}
41-
port: ${{ secrets.DOCKER_PORT }}
42-
user: ${{ secrets.DOCKER_USER }}
43-
pass: ${{ secrets.DOCKER_PASS }}
44-
file: "docker-compose-swarm.yaml"
45-
name: "stack-name"
37+
- name: 'Docker Stack Deploy'
38+
uses: cssnr/stack-deploy-action@v1
39+
with:
40+
host: ${{ secrets.DOCKER_HOST }}
41+
port: ${{ secrets.DOCKER_PORT }}
42+
user: ${{ secrets.DOCKER_USER }}
43+
pass: ${{ secrets.DOCKER_PASS }}
44+
file: 'docker-compose-swarm.yaml'
45+
name: 'stack-name'
4646
```
4747
4848
## Examples
4949
5050
Simple Example
5151
5252
```yaml
53-
name: "Test Docker Stack Deploy"
53+
name: 'Test Docker Stack Deploy'
5454

5555
on:
5656
push:
5757

5858
jobs:
5959
deploy:
60-
name: "Deploy"
60+
name: 'Deploy'
6161
runs-on: ubuntu-latest
6262
timeout-minutes: 5
6363

6464
steps:
65-
- name: "Checkout"
65+
- name: 'Checkout'
6666
uses: actions/checkout@v4
6767

68-
- name: "Docker Stack Deploy"
68+
- name: 'Docker Stack Deploy'
6969
uses: cssnr/stack-deploy-action@v1
7070
with:
7171
host: ${{ secrets.DOCKER_HOST }}
7272
port: ${{ secrets.DOCKER_PORT }}
7373
user: ${{ secrets.DOCKER_USER }}
7474
pass: ${{ secrets.DOCKER_PASS }}
75-
file: "docker-compose-swarm.yaml"
76-
name: "stack-name"
75+
file: 'docker-compose-swarm.yaml'
76+
name: 'stack-name'
7777
```
7878
7979
Full Example
8080
8181
```yaml
82-
name: "Test Docker Stack Deploy"
82+
name: 'Test Docker Stack Deploy'
8383

8484
on:
8585
workflow_dispatch:
@@ -90,54 +90,54 @@ on:
9090
default: 'latest'
9191

9292
env:
93-
REGISTRY: "ghcr.io"
93+
REGISTRY: 'ghcr.io'
9494

9595
jobs:
9696
deploy:
97-
name: "Deploy"
97+
name: 'Deploy'
9898
runs-on: ubuntu-latest
9999
timeout-minutes: 5
100100

101101
steps:
102-
- name: "Checkout"
102+
- name: 'Checkout'
103103
uses: actions/checkout@v4
104104

105-
- name: "Generate Tags"
105+
- name: 'Generate Tags'
106106
id: tags
107107
uses: smashedr/docker-tags-action@master
108108
with:
109-
images: "$${{ env.REGISTRY }}/${{ github.repository }}"
109+
images: '$${{ env.REGISTRY }}/${{ github.repository }}'
110110
extra: ${{ inputs.tags }}
111111

112-
- name: "Setup Buildx"
112+
- name: 'Setup Buildx'
113113
uses: docker/setup-buildx-action@v2
114114
with:
115115
platforms: linux/amd64,linux/arm64
116116

117-
- name: "Docker Login"
117+
- name: 'Docker Login'
118118
uses: docker/login-action@v2
119119
with:
120120
registry: $${{ env.REGISTRY }}
121121
username: ${{ secrets.GHCR_USER }}
122122
password: ${{ secrets.GHCR_PASS }}
123123

124-
- name: "Build and Push"
124+
- name: 'Build and Push'
125125
uses: docker/build-push-action@v4
126126
with:
127127
context: .
128128
platforms: linux/amd64,linux/arm64
129129
push: true
130130
tags: ${{ steps.tags.outputs.tags }}
131131

132-
- name: "Docker Stack Deploy"
132+
- name: 'Docker Stack Deploy'
133133
uses: cssnr/stack-deploy-action@v1
134134
with:
135135
host: ${{ secrets.DOCKER_HOST }}
136136
port: ${{ secrets.DOCKER_PORT }}
137137
user: ${{ secrets.DOCKER_USER }}
138-
ssh_key: "${{ secrets.DOCKER_SSH_KEY }}"
139-
file: "docker-compose-swarm.yaml"
140-
name: "stack-name"
138+
ssh_key: '${{ secrets.DOCKER_SSH_KEY }}'
139+
file: 'docker-compose-swarm.yaml'
140+
name: 'stack-name'
141141
```
142142
143143
# Support
@@ -164,6 +164,7 @@ Additionally, you can support other GitHub Actions I have published:
164164
- [Update Version Tags Action](https://github.com/cssnr/update-version-tags-action)
165165
- [Update JSON Value Action](https://github.com/cssnr/update-json-value-action)
166166
- [Parse Issue Form Action](https://github.com/cssnr/parse-issue-form-action)
167+
- [Mirror Repository Action](https://github.com/cssnr/mirror-repository-action)
167168
- [Portainer Stack Deploy](https://github.com/cssnr/portainer-stack-deploy-action)
168169
- [Mozilla Addon Update Action](https://github.com/cssnr/mozilla-addon-update-action)
169170

0 commit comments

Comments
 (0)