|
| 1 | + |
| 2 | + |
1 | 3 | # Square Cloud Action |
| 4 | + |
2 | 5 | The easiest way to integrate your Square Cloud app with GIT, commit your app from github workflows. |
3 | 6 |
|
4 | | -# Usage |
| 7 | +## Usage |
5 | 8 |
|
6 | 9 | ### Pre-requisites |
7 | | -Create a `.yml` workflow file in the `.github/workflows` directory. Here is an [example workflow](#example-workflow). If you want to know more about workflows, see the official GitHub Help Documentation on how to [create a workflow file](https://docs.github.com/en/actions/using-workflows#creating-a-workflow-file) |
8 | 10 |
|
9 | | -You also need to configure your GitHub secrets, of course, to not let your Token API be exposed. See how to [configure your GitHub secrets](#configuring-secrets). |
| 11 | +Create a `.yml` workflow file in the `.github/workflows` directory. |
| 12 | +Here is an [example workflow](#example-workflow). |
| 13 | +If you want to know more about workflows, see the official GitHub Help Documentation on how to [create a workflow file](https://docs.github.com/en/actions/using-workflows#creating-a-workflow-file) |
| 14 | + |
| 15 | +You also need to configure your GitHub secrets, of course, to not let your Token API be exposed. |
10 | 16 |
|
11 | 17 | ### Inputs |
12 | | -- `token` - Your Square Cloud api token. Get your token from the [Square Cloud dashboard](https://squarecloud.app/dashboard/me) `Required` |
13 | | -- `application_id` - Your Square Cloud application ID. `Required` |
14 | | -- `restart` - After commit, does the application need to be restarted? `Optional`, `Default: False` |
15 | | -- `excludes` - Files that shouldn't be uploaded to Square Cloud. (by default, includes `.git`) `Optional` |
| 18 | + |
| 19 | +- `token` - Your Square Cloud api token. Get your token from the [Square Cloud dashboard](https://squarecloud.app/dashboard) `Required` |
| 20 | +- `command` - The command you want to execute `Optional` |
| 21 | +- `install-only` - In case you just want to install the CLI in your workflow `Optional` |
| 22 | +- `workdir` - The directory you want to work with the Action `Optional` |
16 | 23 |
|
17 | 24 | ### Example Workflow |
18 | | -#### Uploading your application and restarting it |
19 | | -```yml |
20 | | -name: "Commit project to Square Cloud" |
21 | | -on: push |
22 | 25 |
|
23 | | -jobs: |
24 | | - deploy: |
25 | | - runs-on: ubuntu-latest |
26 | | - steps: |
27 | | - - uses: actions/checkout@v3 |
28 | | - with: |
29 | | - fetch-depth: '0' |
30 | | - |
31 | | - - name: Commit to Square Cloud |
32 | | - uses: squarecloudofc/github-action@v1.3.0 |
33 | | - with: |
34 | | - restart: true |
35 | | - token: '${{ secrets.SQUARE_TOKEN }}' |
36 | | - application_id: '${{ secrets.SQUARE_APPLICATIONID }}' |
37 | | -``` |
| 26 | +##### Commiting your project to Square Cloud |
38 | 27 |
|
39 | | -#### Uploading your application with file exclusions |
40 | | -```yml |
41 | | -name: "Commit project to Square Cloud" |
42 | | -on: push |
| 28 | +Useful if you just want update the source code of your application |
43 | 29 |
|
| 30 | +```yml |
| 31 | +name: Publish |
| 32 | +on: |
| 33 | + push: |
| 34 | + branches: |
| 35 | + - master |
44 | 36 | jobs: |
45 | | - deploy: |
| 37 | + publish-production: |
| 38 | + name: Publish |
46 | 39 | runs-on: ubuntu-latest |
47 | 40 | steps: |
48 | | - - uses: actions/checkout@v3 |
49 | | - with: |
50 | | - fetch-depth: '0' |
51 | | - |
52 | | - - name: Commit to Square Cloud |
53 | | - uses: squarecloudofc/github-action@v1.3.0 |
| 41 | + - name: Setup Square Cloud |
| 42 | + uses: squarecloudofc/github-action@v2 |
| 43 | + # in the run command you can add the --restart flag to restart your application after the commit |
54 | 44 | with: |
| 45 | + run: commit ${{ secrets.SQUARE_APPLICATION_ID }} |
55 | 46 | token: '${{ secrets.SQUARE_TOKEN }}' |
56 | | - application_id: '${{ secrets.SQUARE_APPLICATIONID }}' |
57 | | - excludes: '.vscode docs' |
58 | | -``` |
59 | | -
|
60 | | -### Configuring Secrets |
61 | | -#### 1. Go to your repository where you want to configure the workflow |
62 | | -#### 2. Under your repository name, click **Settings** |
63 | | -
|
64 | | - |
65 | | -
|
66 | | -#### 3. In the "Security" section of the sidebar, select **Secrets and varibles**, then click **Actions** |
67 | | -
|
68 | | - |
69 | 47 |
|
70 | | -#### 4. In the **Secrets** tab, click **New repository secret** |
71 | | -
|
72 | | -<img src="https://media.discordapp.net/attachments/646857534963056661/1071152354491121754/image.png" height="180"></img> |
73 | | -
|
74 | | -#### 5. Type a name for your secret in the **Name** input box. |
75 | | -#### 6. Enter the value for your secret |
76 | | -#### 7. Click **Add secret.** |
77 | | -#### 8. And you're done, your Secrets are configured and you're ready to use the workflow |
78 | | -
|
79 | | -<img src="https://cdn.discordapp.com/attachments/646857534963056661/1071153498282004490/image.png" height="480"></img> |
| 48 | +``` |
80 | 49 |
|
81 | 50 | # Contributors |
82 | | -We are currently accepting all kinds of suggestions and contributions. All you have to do is open an Issue or a Pull Request! |
83 | 51 |
|
84 | | -Created with ❤ by [richaardev](https://github.com/richaardev) |
| 52 | +We are currently accepting all kinds of suggestions and contributions. All you have to do is open an Issue or a Pull Request! |
0 commit comments