-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/add static web workflows #2
Open
steplixleandro
wants to merge
45
commits into
main
Choose a base branch
from
feature/addStaticWebWorkflows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 43 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
8c1163c
adding static web in s3 workflows templates
steplixleandro d1ac623
change reference to reposiory
steplixleandro 22765d4
refactor pipes
steplixleandro e4b5cd7
refactor finish
steplixleandro a554c9d
fix references problems
steplixleandro bd3b9c1
testing
steplixleandro a878d9d
debuggin
steplixleandro 20f6e37
prueba
steplixleandro d844773
debug
steplixleandro e6fb8d4
Fix reference problem
steplixleandro 1492f14
fix bug
steplixleandro 679d740
fix bug
steplixleandro 739c174
push
steplixleandro 3fa4e95
fix
steplixleandro aef5c39
test
steplixleandro f808468
fix event
steplixleandro 5932001
adding package publish pipes
fGrennon fc62393
adding templates for publish npm
fGrennon 5e8fae9
fixing publish npm
fGrennon fe3d069
fix update package.json in publish npm
fGrennon 1e72360
fix publish npm flow
fGrennon ebf3487
fix publish npm flow
fGrennon 52bf159
fix tag in publish npm flow
fGrennon d924dbb
bitbucket scripts
snobili-steplix caa078a
final bb pipeline
snobili-steplix 2f519b7
Adding react native mobile pipelines
fGrennon 91ce0e4
adding static web in s3 workflows templates
steplixleandro 21313d0
change reference to reposiory
steplixleandro 3fee2ec
refactor pipes
steplixleandro ee756f9
refactor finish
steplixleandro 885ad4b
fix references problems
steplixleandro 9684bd2
testing
steplixleandro 0ee90e6
debuggin
steplixleandro fc339de
prueba
steplixleandro a9c202e
debug
steplixleandro 7c01799
Fix reference problem
steplixleandro cf5bfe8
fix bug
steplixleandro 9a32bfe
fix bug
steplixleandro 004854f
push
steplixleandro a46fc34
fix
steplixleandro 5907f15
test
steplixleandro 68e3f47
fix event
steplixleandro 91f20d8
Merge branch 'feature/addStaticWebWorkflows' of github.com:steplix/ci…
steplixleandro 98b3cb7
changes
steplixleandro d79a0f3
notify on error
steplixleandro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Push in development branch | ||
run-name: > | ||
"Create PR FROM develop TO ${{ inputs.DESTINATION_PR_ON_DEVELOP_WORKFLOW }}: ${{ github.event.head_commit.message }}" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
NODE_VERSION: | ||
description: 'Node version to use' | ||
type: string | ||
default: 14.18.0 | ||
required: false | ||
DESTINATION_PR: | ||
description: 'Branch to target MR' | ||
type: string | ||
default: testing | ||
required: false | ||
PR_TITLE: | ||
type: string | ||
description: "Title for the pr" | ||
default: "Pushing develop" | ||
required: false | ||
SLACK_CHANNEL: | ||
type: string | ||
description: Slack channel to send notifications | ||
required: false | ||
secrets: | ||
SLACK_WEBHOOK_URL: | ||
required: true | ||
|
||
jobs: | ||
|
||
testing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.NODE_VERSION }} | ||
- run: npm ci | ||
- run: npm run lint --if-present | ||
- run: npm run test --if-present | ||
- run: echo "TEST SUCCESSFULLY" | ||
|
||
build: | ||
needs: [ testing ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.NODE_VERSION }} | ||
- run: npm ci | ||
- run: npm run release | ||
|
||
|
||
generate-pr: | ||
needs: [ build ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: generate-pr | ||
id: open-pr | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
destination_branch: ${{ inputs.DESTINATION_PR }} | ||
pr_title: ${{ inputs.PR_TITLE }} | ||
- run: echo "PR GENERATED SUCCESSFULLY" | ||
|
||
notify: | ||
if: ${{ always() }} | ||
needs: [testing, build, generate-pr] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify Slack | ||
uses: steplix/[email protected] | ||
with: | ||
template: 'push' | ||
status: ${{ needs.testing.result || needs.build.result || needs.generate-pr.result }} | ||
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
channel: ${{ inputs.SLACK_CHANNEL }} |
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,92 @@ | ||
name: Push Hotfix in master branch | ||
run-name: > | ||
Push: ${{ github.ref_name }} | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
NODE_VERSION: | ||
description: 'Node version to use' | ||
type: string | ||
default: 14.18.0 | ||
required: false | ||
DESTINATION_PR_MASTER: | ||
description: 'Branch to target MR' | ||
type: string | ||
default: master | ||
required: false | ||
DESTINATION_PR_DEVELOP: | ||
description: 'Branch to target MR' | ||
type: string | ||
default: develop | ||
required: false | ||
SLACK_CHANNEL: | ||
type: string | ||
description: Slack channel to send notifications | ||
required: false | ||
secrets: | ||
SLACK_WEBHOOK_URL: | ||
required: true | ||
|
||
jobs: | ||
|
||
testing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.NODE_VERSION }} | ||
- run: npm ci | ||
- run: npm run lint --if-present | ||
- run: npm run test --if-present | ||
- run: echo "TEST SUCCESSFULLY" | ||
|
||
build: | ||
needs: [ testing ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.NODE_VERSION }} | ||
- run: npm ci | ||
- run: npm run release | ||
|
||
generate-pr-to-master: | ||
needs: [testing,build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: generate-pr | ||
id: open-pr | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
destination_branch: ${{ inputs.DESTINATION_PR_MASTER }} | ||
pr_title: "<patch> is TAG VERSION INCREMENT: Pushing HOTFIX ${{ github.ref_name }} into ${{ inputs.DESTINATION_PR_MASTER }}" | ||
- run: echo "PR GENERATED SUCCESSFULLY" | ||
|
||
generate-pr-to-develop: | ||
needs: [testing,build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: generate-pr | ||
id: open-pr | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
destination_branch: ${{ inputs.DESTINATION_PR_DEVELOP }} | ||
pr-title: "Pushing HOTFIX ${{ github.ref_name }} into ${{ inputs.DESTINATION_PR_DEVELOP }}" | ||
|
||
notify: | ||
if: ${{ always() }} | ||
needs: [ testing,build,generate-pr-to-master,generate-pr-to-develop ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify Slack | ||
uses: steplix/[email protected] | ||
with: | ||
template: 'push' | ||
status: ${{ needs.testing.result || needs.build.result || needs.generate-pr-to-master.result || needs.generate-pr-to-develop.result }} | ||
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} | ||
channel: ${{ inputs.SLACK_CHANNEL }} |
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,99 @@ | ||
name: Push in master branch | ||
run-name: > | ||
${{ github.event.pull_request.title }} | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
NODE_VERSION: | ||
description: 'Node version to use' | ||
type: string | ||
default: 14.18.0 | ||
required: false | ||
SLACK_CHANNEL: | ||
type: string | ||
description: Slack channel to send notifications | ||
required: false | ||
AWS_BUCKET: | ||
type: string | ||
description: Bucket S3 to copy files for deploy | ||
required: true | ||
TEXT-WHERE-SEARCH-FOR-PARAMETERS: | ||
type: string | ||
description: 'Message to parse. Defaults to head commit message' | ||
required: false | ||
default: ${{ github.event.head_commit.message }} | ||
secrets: | ||
SLACK_WEBHOOK_URL: | ||
required: true | ||
AWS_KEY_ID: | ||
required: true | ||
AWS_SECRET_ACCESS_KEY: | ||
required: true | ||
AWS_REGION: | ||
required: true | ||
|
||
|
||
jobs: | ||
|
||
tagging: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.bumped_tag.outputs.version }} | ||
steps: | ||
- uses: steplix/[email protected] | ||
id: args | ||
with: | ||
message: ${{ inputs.TEXT-WHERE-SEARCH-FOR-PARAMETERS}} | ||
param-0: major | ||
param-1: minor | ||
|
||
- name: Get bumping mode | ||
id: bump-mode | ||
run: echo "mode=${{ (steps.args.outputs.param-0 == 'true' && 'major') || (steps.args.outputs.param-1 == 'true' && 'minor') || 'patch' }}" >> $GITHUB_OUTPUT | ||
|
||
# Bump tag without affecting repository | ||
- uses: zwaldowski/semver-release-action@v3 | ||
name: Get bumped tag | ||
id: bumped_tag | ||
with: | ||
bump: ${{ steps.bump-mode.outputs.mode }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-zip-upload: | ||
needs: [ tagging ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.NODE_VERSION }} | ||
- run: npm ci | ||
- run: npm run release | ||
#ZIP | ||
- name: generate-zip | ||
id: zip | ||
run: cd out && tar -czvf ${{ needs.tagging.outputs.tag }}.tar.gz * | ||
|
||
#UPLOAD | ||
- uses: aws-actions/[email protected] | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
- name: copy files to S3 | ||
run: | | ||
aws s3 cp out/${{ needs.tagging.outputs.tag }}.tar.gz s3://${{ inputs.AWS_BUCKET }}/${{ needs.tagging.outputs.tag }}.tar.gz | ||
|
||
|
||
notify: | ||
if: ${{ always() }} | ||
needs: [ tagging,build-zip-upload ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify Slack | ||
uses: steplix/[email protected] | ||
with: | ||
template: 'push' | ||
status: ${{ needs.tagging.result || needs.build-zip-upload.result }} | ||
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} |
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,81 @@ | ||
name: Deployment to production | ||
run-name: > | ||
Production deployment ${{ github.event.release.tag_name }}: ${{ github.event.release.name }} | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
SLACK_CHANNEL: | ||
type: string | ||
description: Slack channel to send notifications | ||
required: false | ||
AWS_BUCKET: | ||
type: string | ||
description: Bucket S3 to copy files for deploy | ||
required: true | ||
AWS_BUCKET_ARTIFACT: | ||
type: string | ||
description: Bucket S3 to download artifact to deploy | ||
required: true | ||
AWS_CLOUDFRONT_DISTRIBUTION_ID: | ||
type: string | ||
description: CloudFront Distribution ID | ||
required: true | ||
secrets: | ||
SLACK_WEBHOOK_URL: | ||
required: true | ||
AWS_KEY_ID: | ||
required: true | ||
AWS_SECRET_ACCESS_KEY: | ||
required: true | ||
AWS_REGION: | ||
required: true | ||
|
||
jobs: | ||
|
||
## DEPLOY | ||
|
||
download_unzip_deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
#DOWNLOAD | ||
- uses: aws-actions/[email protected] | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: download zip from S3 | ||
run: | | ||
aws s3 cp s3://${{ inputs.AWS_BUCKET_ARTIFACT }}/${{ github.event.release.tag_name }}.tar.gz . | ||
#UNZIP | ||
- name: mkdir | ||
run: mkdir output | ||
|
||
- name: un-zip | ||
id: unzip | ||
run: tar -xvzf ${{ github.event.release.tag_name }}.tar.gz -C output | ||
|
||
#UPLOAD | ||
|
||
- name: copy files to S3 | ||
run: | | ||
aws s3 sync output s3://${{ inputs.AWS_BUCKET }} | ||
- name: Cloudfront invalidation | ||
run: | | ||
aws cloudfront create-invalidation --distribution-id ${{ inputs.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" | ||
|
||
|
||
|
||
notify: | ||
if: ${{ always() }} | ||
needs: [ download_unzip_deploy ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify Slack | ||
uses: steplix/[email protected] | ||
with: | ||
template: 'push' | ||
status: ${{ needs.download_unzip_deploy.result}} | ||
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} | ||
channel: ${{ inputs.SLACK_CHANNEL }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No notificaria errores en develop