في مقال سابق (باللغة البرتغالية) ، تناولت كيفية إنشاء واجهة GraphQL كاملة الوظائف باستخدام صورة Docker وملف التكوين فقط. يمكن العثور على كل هذا على موقع Azure . في الوقت الحالي ، دعنا نتحدث عن كيفية أتمتة عمليات النشر التي تم إنشاؤها لاستضافتنا والتحديثات من جانب الخادم!
الهدف من هذا المشروع بأكمله هو إنشاء نهاية خلفية لأرشيف المحتوى المستقبلي الخاص بي ليتم استضافته على موقعي . ومع ذلك ، عندما أقوم بتحديث الواجهة الخلفية أو تغيير مخطط GraphQL ، يجب أن أقوم بنشر خدمة كاملة مرة أخرى.
, push Azure. . , , GitHub Azure. , GitHub , ?
GitHub, , Travis Circle, . , .
: + backend-:

, , : docker-compose.yml mongoke.yml, GraphQL.
, , «» — !

GitHub , , , . ? , :
- push
- Azure main service, , Azure/login
- Azure/cli, .
:
- GitHub , , URL- YAML- Mongoke
- URI MongoDB,
-, : , , URL- MongoDB . «» «». , « » . URI MongoDB, MONGODB_URI.

Azure
GitHub Azure, Service Principal. .
Azure CLI. az login, :
az ad sp create-for-rbac --name <SP-name> --role contributor --scopes /subscriptions/<subscriptionID>/resourceGroups/<resourcegroupname> --sdk-auth
ID , az account list : isDefault true. , , : , .
: , , Resource Group. « -», - .
JSON :
{
"clientId": "xxxxxxx",
"clientSecret": "xxxxxxxx",
"subscriptionId": "xxxxxxxx",
...
}
GitHub AZURE_CREDENTIALS:

:

, «» «» « »:

, :

, GitHub Actions — , YAML- /.Github/workflows. , . publish-prod.yml:

:

— GitHub, :

, . , push , , , . , , intellisense:

, . . the official documentation
, , , . env:

, . , . , . , :

Ubuntu, : in the documentation. . — , . , !
, Azure ! Azure/ :

. , :

. , AZURE_CREDENTIALS. , , : $ {{secrets.AZURE_CREDENTIALS}}.
:

, « », — Azure. run, , . :

, MONGOKE_CONFIG_URL. , SHA- , . , . « URL-».
Workflow Command, GitHub Actions, ::. set-env, . : ::set-env name=<name>::<value>, :

, ${{env.MONGOKE_CONFIG_URL}} ?v= native environment variable, GITHUB_SHA. :

, , . MONGOKE_CONFIG_URL, MONGOKE_URL:

:

« » :

«»:

, . , , :

Azure , :

, , URL- :

7 Azure , , , , !
GitHub Actions !
!
. - , dev.to
