Skip to content

Setup continuous deployment #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 27, 2019
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
34 changes: 34 additions & 0 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Continuous Deployment

on:
push:
branches:
- master
- develop

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

env:
SOURCE_DIR: "build/"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

steps:
- uses: actions/checkout@v1

- name: Install dependencies
run: yarn

- name: Build
run: yarn build

- name: Deploy
uses: jakejarvis/s3-sync-action@v0.5.0
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.STAGING_AWS_S3_BUCKET }}
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app) and was built with the purpose to serve as a companion for the blog article: [How to setup a continuous integration and deployment workflow for ReactJS using Github actions](www.coletiv.com/blog/how_to_setup_a_continuous_integration_and_deployment_workflow_for_reactjs_using_github_actions)

## Available Scripts

Expand Down Expand Up @@ -27,16 +27,6 @@ Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
Expand Down
22 changes: 15 additions & 7 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import React from "react";
import logo from "./logo.svg";
import "./App.css";

const App: React.FC = () => {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
<a
className="App-link"
href="www.coletiv.com"
target="_blank"
rel="noopener noreferrer"
>
Coletiv
</a>{" "}
companion website for the Github Actions example
</p>
<a
className="App-link"
href="https://reactjs.org"
href="https://github.com/coletiv/react-js-github-actions-example"
target="_blank"
rel="noopener noreferrer"
>
Learn React
Github Repository
</a>
</header>
</div>
);
}
};

export default App;