-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: create docker deployment workflow
- Loading branch information
1 parent
48ce674
commit 45c98d7
Showing
4 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ node_modules | |
package-lock.json | ||
package.json | ||
php.ini | ||
plugins | ||
src | ||
tasks | ||
test | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build Docker Image | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
if: ${{ vars.DEPLOY_WITH_DOCKER }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: Install custom plugin npm dependencies | ||
run: npm run plugins:install | ||
|
||
- name: Install PHP dependencies with Composer | ||
uses: php-actions/composer@v6 | ||
with: | ||
php_version: '8.1' | ||
version: 2.x | ||
|
||
- name: Run tests | ||
run: npm test | ||
|
||
- name: Build theme | ||
run: npm run build:prod | ||
|
||
- name: 'Login to GitHub Container Registry' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GH_TOKEN}} | ||
|
||
- name: 'Build Inventory Image' | ||
run: | | ||
docker build . --tag ghcr.io/sparkbox/sparkpress:latest | ||
docker push ghcr.io/sparkbox/sparkpress:latest |
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
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