Skip to content

Commit

Permalink
test deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensOost committed Jul 22, 2024
1 parent 8cd1ddb commit 70df5a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Create .env file
- name: Replace secrets in files
run: |
echo "REACT_APP_EMAILJS_PUBLIC_KEY=${{ secrets.EMAILJS_PUBLIC_KEY }}" >> .env
echo "REACT_APP_EMAILJS_SERVICE_ID=${{ secrets.EMAILJS_SERVICE_ID }}" >> .env
echo "REACT_APP_EMAILJS_TEMPLATE_ID=${{ secrets.EMAILJS_TEMPLATE_ID }}" >> .env
sed -i 's|-HXjHlEI8ydoyacHi|${{ secrets.EMAILJS_PUBLIC_KEY }}|g' path/to/your/index.html
sed -i 's|service_ikab6sp|${{ secrets.EMAILJS_SERVICE_ID }}|g' path/to/your/index.html
sed -i 's|template_fl1p6kp|${{ secrets.EMAILJS_TEMPLATE_ID }}|g' path/to/your/index.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
11 changes: 8 additions & 3 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
<link rel="stylesheet" href="styles.css">
<script type="text/javascript" src="https://cdn.emailjs.com/dist/email.min.js"></script>
<script type="text/javascript">
// Placeholder values to be replaced by GitHub Actions
const EMAILJS_PUBLIC_KEY = 'REPLACE_WITH_EMAILJS_PUBLIC_KEY';
const EMAILJS_SERVICE_ID = 'REPLACE_WITH_EMAILJS_SERVICE_ID';
const EMAILJS_TEMPLATE_ID = 'REPLACE_WITH_EMAILJS_TEMPLATE_ID';

(function(){
emailjs.init(process.env.REACT_APP_EMAILJS_PUBLIC_KEY);
emailjs.init(EMAILJS_PUBLIC_KEY);
})();
</script>
</head>
Expand Down Expand Up @@ -51,8 +56,8 @@ <h1>CONTACT/BOOKING</h1>
event.preventDefault();

emailjs.sendForm(
process.env.REACT_APP_EMAILJS_SERVICE_ID,
process.env.REACT_APP_EMAILJS_TEMPLATE_ID,
EMAILJS_SERVICE_ID,
EMAILJS_TEMPLATE_ID,
this
).then(function() {
console.log('SUCCESS!');
Expand Down

0 comments on commit 70df5a5

Please sign in to comment.