Skip to content
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

Lately applied some changes #9

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
68 changes: 68 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and deploy

on: [push]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./code
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm test

- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: artifact
path: ./code/dist

deploy:
runs-on: ubuntu-latest
name: Deploy application to Azure Static Websites
needs: build
steps:
- name: Get artifact from build step
uses: actions/download-artifact@v3
with:
name: artifact
- name: Deploy
id: deploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: "upload"
app_location: "."
# The following lines of code are meant to be used by AWS for deployment there instead of Azure
# You might check how to do it
# deploy:
# runs-on: ubuntu-latest
# name: Deploy application to AWS
# needs: build
# steps:
# - name: Get artifact from buil step
# uses: actions/download-artifact@v3
# with:
# name: artifact
# - name: Install AWS CLI
# run: I
# aws configure set aws_Access_key_id${{
# secrets.AWS_ACCESS_KEY_ID}}
# aws configure set aws_secrets_access_key${{
# secrets.AWS_SECRET_ACCESS_KEY}}
# aws configure set default.region${{secrets.AWS_REGION}}
# - name: Deploy
# run: I
# AWS_DEFAULT_REGION:${{secrets.AWS_REGION}}
# AWS_ACCESS_KEY_ID:${{secrets.AWS_ACCESS_KEY_ID}}
# AWS_SECRET_ACCESS_KEY:${{secrets.AWS_SECRET_ACCESS_KEY}}
#

5 changes: 2 additions & 3 deletions code/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./src/style.css">
<title>My Page</title>
<link rel="stylesheet" href="./src/style.css" />
<title>Build and Deploy</title>
</head>
<body>
<div class="clock-container">
Expand All @@ -15,7 +15,6 @@ <h2 id="time"></h2>

<span>Seconds left of year</span>
<h2 id="seconds-left"></h2>

</div>
<script type="module" src="./src/main.js"></script>
</body>
Expand Down
Loading