Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Check

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up NodeJS
uses: actions/setup-node@v4
with:
node-version: '10'
cache: 'npm'

- name: Setup Python (for node-gyp)
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run compile
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy to S3

on:
push:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '10'
cache: 'npm'

- name: Setup Python (for node-gyp)
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run compile

- name: Prepare deployment files
run: |
cp -r public/images deploy/
cp -r public/scripts deploy/
cp -r public/styles deploy/
cp -r public/styleguide deploy/
cp public/*.html deploy/

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Deploy to S3 (giraffe)
run: |
aws s3 sync deploy/ s3://static.moveon.org/giraffe \
--acl public-read \
--cache-control "max-age=31536000"

- name: Deploy to S3 (giraffe-staging)
run: |
aws s3 sync deploy/ s3://static.moveon.org/giraffe-staging \
--acl public-read
28 changes: 0 additions & 28 deletions .github/workflows/npm-gulp.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/node_modules
/public
/package
/package-lock.json
deploy
*~
.#*
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v10.18.0
v10
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

18 changes: 7 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# Contributing

## Development Requirements
- Node v7.10.1 and above
- NPM
- Gulp, installed globally


## Local Setup

- Clone this repository.
- Install node dependencies: `npm install`
- [Install nvm if you haven't previously used it](https://github.com/nvm-sh/nvm#installing-and-updating)
- Install/set NodeJS version: `nvm install`
- Install node dependencies: `npm ci`
- Edit .env to set `ENV=LOCAL`
- Run `gulp watch` to boot up local development server and build tools. Normally this would boot up `localhost:3000`, or whichever port is available.
- Run `npm run watch` to boot up local development server and build tools. Normally this would boot up `localhost:3000`, or whichever port is available.
- Get some coffee. Shake up. Start coding :).

## Build

Run `gulp` to compile all the source files into the `public` folder.
Run `npm run compile` to compile all the source files into the `public` folder.

Run `yarn zip` to create a compressed zip file. This is saved as `moveon.zip` in the `public` folder.
Run `npm run zip` to create a compressed zip file. This is saved as `moveon.zip` in the `public` folder.


## Files and Directories
Expand All @@ -30,7 +26,7 @@ The local server files are located inside the `public` folder.

### Templates

Templates are **twig** files compiled into html through `gulp pages`. They are located in `src/templates`.
Templates are **twig** files compiled into html through `npx gulp pages`. They are located in `src/templates`.

For Twig templating guides, please refer to their [site](https://twig.symfony.com/doc/2.x/templates.html).

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ For development please read **CONTRIBUTING.md**.

Deploy CSS, JS, images and fonts to AWS S3 (for MoveOn devs)

Updating `main` branch and pushing to github with ENV=production (in .env) triggers AWS S3 autodeploy via Travis. Minified assets are copied from public/fonts, public/images, public/scripts and public/styles into the `deploy` directory and then pushed to https://static.moveon.org/giraffe/. See `.travis.yml` for details.
Merging a PR into the remote GitHub repo's `main` branch with ENV=production (in `.env`) triggers AWS S3 auto-deploy via a GitHub Workflow. Minified assets are copied from public/fonts, public/images, public/scripts and public/styles into the `deploy` directory and then pushed to https://static.moveon.org/giraffe/. See `.github/workflows/deploy.yml` for details.

To generate a new encrypted secret_access_key, install the travis command line tool https://github.com/travis-ci/travis.rb#installation and then run the `travis encrypt` command in https://docs.travis-ci.com/user/deployment/s3/ using the credentials for an aws user with write access to the proper s3 bucket. Be sure to lint your updated config with `travis lint .travis.yml`!
Secrets used in workflows are stored in [the GitHub repo's repository secrets](https://github.com/MoveOnOrg/giraffe/settings/secrets/actions).

### Uglify and minify assets

Expand Down
Loading